I am using Netty 4.0.0.Beta2
I have a pipeline which is configured with several handlers, the last of which runs in its own EventExecutorGroup. A little like so:
DefaultEventExecutorGroup separateGroup = new DefaultEventExecutorGroup();
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(AGGREGATE, new SomeHandler());
pipeline.addLast(ENCODE, new OtherHandler());
pipeline.addLast(extractEventGroup, EXECUTE, new ExecuteHandler());
I then configure a ServerBootstrap with this pipeline configuration as a part of the ChannelInitalizer.
As the server runs, I keep a track of all current clients in a ChannelGroup called 'channels'
Later, when I shut the server down, I flush and close all the channels, then call
bootstrap.shutdown();
That shuts down the NIO EventExecutorGroup, but not the separate DefaultEventExecutorGroup that I have added to the pipeline for my ChannelHandler - meaning the JVM doesn't exit as threads are still active (just waiting, but not released).
I was a little surprised that this wasn't closed as well, so I keep a reference to the DefaultEventExecutorGroup now and manually close that after my bootstrap.shutdown() call:
separateEventGroup.shutdown();
Have I missed something, or is that the expected behaviour of Netty?