Skip to content

Commit

Permalink
Remove redundant epollWaitNow() call in EpollEventLoop#closeAll()
Browse files Browse the repository at this point in the history
Motivation

This is a vestige that was removed in the original PR netty#9535 before it
was reverted, but we missed it when re-applying in netty#9586.

It means there is a possible race condition because a wakeup event could
be missed while shutting down, but the consequences aren't serious since
there's a 1 second safeguard timeout when waiting for it.

Modification

Remove call to epollWaitNow() in EpollEventLoop#closeAll()

Result

Cleanup redundant code, avoid shutdown delay race condition
  • Loading branch information
njhill committed Sep 27, 2019
1 parent fed552d commit 003a81e
Showing 1 changed file with 0 additions and 6 deletions.
Expand Up @@ -425,12 +425,6 @@ void handleLoopException(Throwable t) {
}

private void closeAll() {
try {
epollWaitNow();
} catch (IOException ignore) {
// ignore on close
}

// Using the intermediate collection to prevent ConcurrentModificationException.
// In the `close()` method, the channel is deleted from `channels` map.
AbstractEpollChannel[] localChannels = channels.values().toArray(new AbstractEpollChannel[0]);
Expand Down

0 comments on commit 003a81e

Please sign in to comment.