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
95f3af0a02
commit
5579a91e1d
@ -597,6 +597,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);
|
||||
}
|
||||
}
|
||||
|
@ -414,6 +414,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…
Reference in New Issue
Block a user