NETTY-415 ChannelFuture.setFailure() not called when exception thrown handling Channel.close()
* Made sure the ChannelFuture associated with a downstream event is marked as failure when an exception is raised before it reaches at ChannelSink.
This commit is contained in:
parent
a804c3495e
commit
483f093036
@ -571,6 +571,12 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
try {
|
||||
((ChannelDownstreamHandler) ctx.getHandler()).handleDownstream(ctx, e);
|
||||
} catch (Throwable t) {
|
||||
// Unlike an upstream event, a downstream event usually has an
|
||||
// incomplete future which is supposed to be updated by ChannelSink.
|
||||
// However, if an exception is raised before the event reaches at
|
||||
// ChannelSink, the future is not going to be updated, so we update
|
||||
// here.
|
||||
e.getFuture().setFailure(t);
|
||||
notifyHandlerException(e, t);
|
||||
}
|
||||
}
|
||||
|
@ -388,6 +388,12 @@ public class StaticChannelPipeline implements ChannelPipeline {
|
||||
try {
|
||||
((ChannelDownstreamHandler) ctx.getHandler()).handleDownstream(ctx, e);
|
||||
} catch (Throwable t) {
|
||||
// Unlike an upstream event, a downstream event usually has an
|
||||
// incomplete future which is supposed to be updated by ChannelSink.
|
||||
// However, if an exception is raised before the event reaches at
|
||||
// ChannelSink, the future is not going to be updated, so we update
|
||||
// here.
|
||||
e.getFuture().setFailure(t);
|
||||
notifyHandlerException(e, t);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user