Make sure channelInactive() and channelDeregistered() are triggered even if outboundBuffer.recycle() fails
This commit is contained in:
parent
7215c011ca
commit
fef838f197
@ -523,22 +523,25 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fail all queued messages
|
// fail all queued messages
|
||||||
ChannelOutboundBuffer outboundBuffer = this.outboundBuffer;
|
try {
|
||||||
outboundBuffer.failFlushed(CLOSED_CHANNEL_EXCEPTION);
|
ChannelOutboundBuffer outboundBuffer = this.outboundBuffer;
|
||||||
outboundBuffer.failUnflushed(CLOSED_CHANNEL_EXCEPTION);
|
outboundBuffer.failFlushed(CLOSED_CHANNEL_EXCEPTION);
|
||||||
outboundBuffer.recycle();
|
outboundBuffer.failUnflushed(CLOSED_CHANNEL_EXCEPTION);
|
||||||
this.outboundBuffer = null;
|
outboundBuffer.recycle();
|
||||||
|
} finally {
|
||||||
|
outboundBuffer = null;
|
||||||
|
|
||||||
if (wasActive && !isActive()) {
|
if (wasActive && !isActive()) {
|
||||||
invokeLater(new Runnable() {
|
invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
pipeline.fireChannelInactive();
|
pipeline.fireChannelInactive();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
deregister(voidPromise());
|
||||||
}
|
}
|
||||||
|
|
||||||
deregister(voidPromise());
|
|
||||||
} else {
|
} else {
|
||||||
// Closed already.
|
// Closed already.
|
||||||
promise.setSuccess();
|
promise.setSuccess();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user