Now that LocalChannel#releaseInboundBuffers is only called from the EventLoop (eb4d317b9d) it should clear readInProgress and drain/release the queue. Otherwise if a read event is pending (doBeginRead) was called we may later call channelRead or channelReadComplete after we have closed the channel.

Modifications:
LocalChannel#releaseInboundBuffers should always clear/release the queue and set readInProgress to false

Result:
LocalChannel queue is more reliably cleaned up.
This commit is contained in:
Scott Mitchell 2016-11-21 10:46:21 -08:00
parent eb4d317b9d
commit a25101dd0b

View File

@ -422,9 +422,8 @@ public class LocalChannel extends AbstractChannel {
}
private void releaseInboundBuffers() {
if (readInProgress) {
return;
}
assert eventLoop() == null || eventLoop().inEventLoop();
readInProgress = false;
Queue<Object> inboundBuffer = this.inboundBuffer;
Object msg;
while ((msg = inboundBuffer.poll()) != null) {