My issue seems to be related to:
https://issues.jboss.org/browse/NETTY-433
I’m trying to stop my Netty server but this call never returns:
serverBootstrap.releaseExternalResources();
It’s looping forever in the ExecutorUtil.terminate method when trying to shutdown the worker ThreadPoolExecutor:
org.jboss.netty.util.internal.ExecutorUtil.terminate()
for (;;) {
es.shutdownNow();
es.awaitTermination..
}
The problem is I don’t have any control over the Client connecting to my Server. Is there a way for the server to force the server to stop and simple close the channel and stop worker threads?
What you can do to ensure that your child channels are closed before you do a releaseAllResources is to register all created child channels in a ChannelGroup. When you shutdown, you can call close() on the ChannelGroup and this will close all the channels in it.