Dispatcher may leak memory
Brought to you by:
niallg
In Dispatcher, the dispatch method normally handles bubbled-up throwables by closing the IO channel. It may fail to do this if the handler has been written with its own catch block to consume exceptions. To make Dispatcher more robust, perhaps it should be changed from
private void dispatch() throws Exception {
Channel channel = entity.getChannel();
try {
container.handle(request, response);
} catch(Throwable e) {
channel.close();
}
}
to this
private void dispatch() throws Exception {
Channel channel = entity.getChannel();
try {
container.handle(request, response);
} catch(Throwable e) {
} finally {
channel.close();
}
}
This is not a bug, its how asynchronous requests are processed