Remove redundant event loop shutdown check in Netty4TcpChannel#96856
Remove redundant event loop shutdown check in Netty4TcpChannel#96856original-brownbear merged 1 commit intoelastic:mainfrom original-brownbear:95759
Conversation
This check isn't necessary any longer. We safely close all channels before shutting down the even loop groups so we can not run into the situation that a listener passed to `writeAndFlush` isn't completed. We also don't have this check on the http channel sending. -> remove the check that can cause a bug by double invoking the listener closes #95759
|
Pinging @elastic/es-distributed (Team:Distributed) |
DaveCTurner
left a comment
There was a problem hiding this comment.
Yep seems better to shut these things down gracefully indeed. Can we assert channel.eventLoop().isShutdown() == false to make sure our shutdown process actually works as described?
We can't, the fact that we can run into this situation is exactly what's causing the linked test failure. |
|
Ah ok sorry I missed that this could be running outside the event loop. |
|
I assume you mean: assert (channel.eventLoop().inEventLoop() == false || channel.eventLoop().isShutdown()) == false;? I As far as I can tell there's no guarantee that that's true. Only if we checked for
I guess shut-down just means no new tasks are accepted. Terminated means all tasks are done. |
|
Thanks Tim + David! Merging this since you're on PTO David :) |
Follow up to #96856, turns out this wasn't safe to remove after all. We can't go back to the previous solution though since that had double invocation issues => use notify-once for now until this is fixed in Netty.
This check isn't necessary any longer. We safely close all channels before shutting down the even loop groups so we can not run into the situation that a listener passed to
writeAndFlushisn't completed. We also don't have this check on the http channel sending. -> remove the check that can cause a bug by double invoking the listener when the event loop concurrently closes.closes #95759