NETTY-410 NioWorker write deadlock
Applied the patch provided by Greg Dhuse.
This commit is contained in:
parent
8982838ab2
commit
2acd74db83
@ -506,10 +506,13 @@ class NioWorker implements Runnable {
|
||||
}
|
||||
}
|
||||
channel.inWriteNowLoop = false;
|
||||
}
|
||||
|
||||
fireWriteComplete(channel, writtenBytes);
|
||||
|
||||
// Initially, the following block was executed after releasing
|
||||
// the writeLock, but there was a race condition, and it has to be
|
||||
// executed before releasing the writeLock:
|
||||
//
|
||||
// https://issues.jboss.org/browse/NETTY-410
|
||||
//
|
||||
if (open) {
|
||||
if (addOpWrite) {
|
||||
setOpWrite(channel);
|
||||
@ -519,6 +522,9 @@ class NioWorker implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
fireWriteComplete(channel, writtenBytes);
|
||||
}
|
||||
|
||||
private void setOpWrite(NioSocketChannel channel) {
|
||||
Selector selector = this.selector;
|
||||
SelectionKey key = channel.socket.keyFor(selector);
|
||||
|
Loading…
Reference in New Issue
Block a user