Fix lock order inversion between GraphListener and Context (ABI compatible backport) - #3239
Open
skyegalaxy wants to merge 1 commit into
Open
Fix lock order inversion between GraphListener and Context (ABI compatible backport)#3239skyegalaxy wants to merge 1 commit into
skyegalaxy wants to merge 1 commit into
Conversation
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
ahcorde
approved these changes
Aug 27, 2026
Contributor
|
Pulls: #3239 |
Contributor
|
Pulls: #3239 |
Member
Author
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