Don't fail the deregistration promise in Http2MultiplexCodec
Motivation: We deviate from the AbstractChannel implementation on deregistration by failing the provided promise if the channel is already deregistered. In contrast, AbstractChannel will always set the promise to successfully done. Modification: Change the Http2MultiplexCodec.DefaultHttp2StreamChannel.Http2ChannelUnsafe to always set the promise provided to deregister as done as is the case in AbstractChannel.
This commit is contained in:
parent
4c709be1ab
commit
8687e1eeed
@ -966,15 +966,11 @@ public class Http2MultiplexCodec extends Http2FrameCodec {
|
|||||||
if (fireChannelInactive) {
|
if (fireChannelInactive) {
|
||||||
pipeline.fireChannelInactive();
|
pipeline.fireChannelInactive();
|
||||||
}
|
}
|
||||||
// Some transports like local and AIO does not allow the deregistration of
|
// The user can fire `deregister` events multiple times but we only want to fire the pipeline
|
||||||
// an open channel. Their doDeregister() calls close(). Consequently,
|
// event if the channel was actually registered.
|
||||||
// close() calls deregister() again - no need to fire channelUnregistered, so check
|
|
||||||
// if it was registered.
|
|
||||||
if (registered) {
|
if (registered) {
|
||||||
registered = false;
|
registered = false;
|
||||||
pipeline.fireChannelUnregistered();
|
pipeline.fireChannelUnregistered();
|
||||||
} else {
|
|
||||||
promise.setFailure(new IllegalStateException("Not registered"));
|
|
||||||
}
|
}
|
||||||
safeSetSuccess(promise);
|
safeSetSuccess(promise);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user