Now that LocalChannel#releaseInboundBuffers is only called from the EventLoop (eb4d317b9d64f3945a209804fec4c3fe695f4f9f) 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 39f37a608d
commit 52a572affe

View File

@ -417,9 +417,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) {