Skip to content

Commit 330aa70

Browse files
committed
Clean HTTP Resources when NettyWebServer stops
This commit is a temporary workaround for gh-9146; it cleans the HTTP resources associated with the Netty server.
1 parent 2094323 commit 330aa70

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyWebServer.java

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.apache.commons.logging.Log;
2222
import org.apache.commons.logging.LogFactory;
23+
import reactor.ipc.netty.http.HttpResources;
2324
import reactor.ipc.netty.http.server.HttpServer;
2425
import reactor.ipc.netty.tcp.BlockingNettyContext;
2526

@@ -98,6 +99,8 @@ public void run() {
9899
public void stop() throws WebServerException {
99100
if (this.nettyContext != null) {
100101
this.nettyContext.shutdown();
102+
// temporary fix for gh-9146
103+
this.nettyContext.getContext().onClose().doOnSuccess(aVoid -> HttpResources.reset()).block();
101104
this.nettyContext = null;
102105
}
103106
}

0 commit comments

Comments
 (0)