Fix lock order inversion between GraphListener and Context (ABI compatible backport) (backport #3239) - #3242
Open
mergify[bot] wants to merge 1 commit into
Open
Fix lock order inversion between GraphListener and Context (ABI compatible backport) (backport #3239)#3242mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com> Co-authored-by: Skyler Medeiros <skye@polymathrobotics.com> (cherry picked from commit efb669e)
Member
|
Pulls: #3242 |
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.
Description
Avoids inverting lock order between
GraphListener::start_if_not_started()andContext::shutdown()by registering theon_shutdown_callbackbefore acquiringshutdown_mutex_. To avoid duplicate callback registration, a check has been added such that the shutdown callback is de-registered if this thread wasn't the one that started the graph listener (or, if shutting down, throwGraphListenerShutdownError.)Tested against my jazzy container with my reproducing example from #2946. The diff ought to cleanly apply to kilted and humble as well.
Fixes #2946 / #3232 for humble / jazzy / kilted
Is this user-facing behavior change?
no
Did you use Generative AI?
Claude Fable 5
Additional Information
This is an automatic backport of pull request #3239 done by [Mergify](https://mergify.com).