Fix lock order inversion between GraphListener and Context (ABI compatible backport) (backport #3239) - #3241
Fix lock order inversion between GraphListener and Context (ABI compatible backport) (backport #3239)#3241mergify[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)
|
Pulls: #3241 |
|
Pulls: #3241 |
|
@fujitatomoya @ahcorde - the rhel failures look like they're not related. shall I go ahead and merge? |

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).