aslakhellesoy/webbit — comment on commit fa38c4fb0ac7419978ca87d5eb147ea99498bfa2
File: src/main/java/org/webbitserver/netty/StaleConnectionTrackingHandler.java line 45
By joewalnes:

Rather than closing the connection here, do it on the main Webbit thread, to ensure we don't get race conditions with something else happening on the other thread.

So instead of:
entry.getKey().close();

Something like:
final Channel channel = entry.getKey();
executor.execute(new Runnable() {
@Override
public void run() { // run on main webbit thread
channel.close();
}
});

Where 'executor' is NettyWebServer.executor.