Make sure we don't try to use Channel.setReadable(true) if it was not
read-suspend by the threadpool itself. See #215
This commit is contained in:
parent
27bd3e6d82
commit
c2b830a188
@ -438,10 +438,18 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
|
|||||||
//System.out.println("READABLE");
|
//System.out.println("READABLE");
|
||||||
ChannelHandlerContext ctx = eventTask.getContext();
|
ChannelHandlerContext ctx = eventTask.getContext();
|
||||||
if (ctx.getHandler() instanceof ExecutionHandler) {
|
if (ctx.getHandler() instanceof ExecutionHandler) {
|
||||||
// readSuspended = false;
|
// check if the attachment was set as this means that we suspend the channel from reads. This only works when
|
||||||
ctx.setAttachment(null);
|
// this pool is used with ExecutionHandler but I guess thats good enough for us.
|
||||||
|
//
|
||||||
|
// See #215
|
||||||
|
if (ctx.getAttachment() != null) {
|
||||||
|
// readSuspended = false;
|
||||||
|
ctx.setAttachment(null);
|
||||||
|
channel.setReadable(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
channel.setReadable(true);
|
||||||
}
|
}
|
||||||
channel.setReadable(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user