Fix Netty leak on event loop shutdown#97301
Merged
original-brownbear merged 1 commit intoelastic:mainfrom Jul 2, 2023
original-brownbear:fix-netty-leak-clean
Merged
Fix Netty leak on event loop shutdown#97301original-brownbear merged 1 commit intoelastic:mainfrom original-brownbear:fix-netty-leak-clean
original-brownbear merged 1 commit intoelastic:mainfrom
original-brownbear:fix-netty-leak-clean
Conversation
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.
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
Contributor
Author
|
Thanks David! |
original-brownbear
added a commit
that referenced
this pull request
Jul 10, 2023
This is used on the rather hot path now due to #97301, lets apply the optimization of saving one level of indirection here as well to make GC etc. a little cheaper on these.
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 8, 2024
Similar to elastic#97301, the fix in elastic#105293 was still not quite correct: we could in principle shut down the transport after checking `isOpen()` but before sending the message. Applying the same fix as for the transport layer here.
DaveCTurner
added a commit
that referenced
this pull request
Feb 9, 2024
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 9, 2024
Similar to elastic#97301, the fix in elastic#105293 was still not quite correct: we could in principle shut down the transport after checking `isOpen()` but before sending the message. Applying the same fix as for the transport layer here.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 9, 2024
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 14, 2024
We could still be manipulating a network message when the event loop shuts down, causing us to close the message while it's still in use. This is at best going to be a little surprising to the caller, and at worst could be an outright use-after-free bug. This commit moves the double-check for a leaked promise to happen strictly after the event loop has fully terminated, so that we can be sure we've finished using it by this point. Relates elastic#105306, elastic#97301
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 15, 2024
We could still be manipulating a network message when the event loop shuts down, causing us to close the message while it's still in use. This is at best going to be a little surprising to the caller, and at worst could be an outright use-after-free bug. This commit moves the double-check for a leaked promise to happen strictly after the event loop has fully terminated, so that we can be sure we've finished using it by this point. Relates #105306, #97301
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
Feb 15, 2024
We could still be manipulating a network message when the event loop shuts down, causing us to close the message while it's still in use. This is at best going to be a little surprising to the caller, and at worst could be an outright use-after-free bug. This commit moves the double-check for a leaked promise to happen strictly after the event loop has fully terminated, so that we can be sure we've finished using it by this point. Relates elastic#105306, elastic#97301
elasticsearchmachine
pushed a commit
that referenced
this pull request
Feb 15, 2024
We could still be manipulating a network message when the event loop shuts down, causing us to close the message while it's still in use. This is at best going to be a little surprising to the caller, and at worst could be an outright use-after-free bug. This commit moves the double-check for a leaked promise to happen strictly after the event loop has fully terminated, so that we can be sure we've finished using it by this point. Relates #105306, #97301
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.