First fix for: NETTY-114 Selectors of the NIO transport are sometimes not waken up
* Made sure Selector.wakeup() is called, but it can be called more than once if unlucky. Excessive wakeups are still suppressed though.
This commit is contained in:
parent
9959cdd705
commit
d2427cac7a
@ -234,6 +234,13 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
|
||||
try {
|
||||
int selectedKeyCount = selector.select(500);
|
||||
|
||||
// Wake up immediately in the next turn if someone might
|
||||
// have waken up the selector between 'wakenUp.set(false)'
|
||||
// and 'selector.select(...)'.
|
||||
if (wakenUp.get()) {
|
||||
selector.wakeup();
|
||||
}
|
||||
|
||||
processRegisterTaskQueue();
|
||||
|
||||
if (selectedKeyCount > 0) {
|
||||
|
@ -155,6 +155,13 @@ class NioWorker implements Runnable {
|
||||
try {
|
||||
int selectedKeyCount = selector.select(500);
|
||||
|
||||
// Wake up immediately in the next turn if someone might
|
||||
// have waken up the selector between 'wakenUp.set(false)'
|
||||
// and 'selector.select(...)'.
|
||||
if (wakenUp.get()) {
|
||||
selector.wakeup();
|
||||
}
|
||||
|
||||
processRegisterTaskQueue();
|
||||
processWriteTaskQueue();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user