Commit 330aa704 authored by Brian Clozel's avatar Brian Clozel

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.
parent 20943238
...@@ -20,6 +20,7 @@ import java.net.BindException; ...@@ -20,6 +20,7 @@ import java.net.BindException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import reactor.ipc.netty.http.HttpResources;
import reactor.ipc.netty.http.server.HttpServer; import reactor.ipc.netty.http.server.HttpServer;
import reactor.ipc.netty.tcp.BlockingNettyContext; import reactor.ipc.netty.tcp.BlockingNettyContext;
...@@ -98,6 +99,8 @@ public class NettyWebServer implements WebServer { ...@@ -98,6 +99,8 @@ public class NettyWebServer implements WebServer {
public void stop() throws WebServerException { public void stop() throws WebServerException {
if (this.nettyContext != null) { if (this.nettyContext != null) {
this.nettyContext.shutdown(); this.nettyContext.shutdown();
// temporary fix for gh-9146
this.nettyContext.getContext().onClose().doOnSuccess(aVoid -> HttpResources.reset()).block();
this.nettyContext = null; this.nettyContext = null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment