Skip to content

Fix lock order inversion between GraphListener and Context (ABI compatible backport) - #3239

Open
skyegalaxy wants to merge 1 commit into
jazzyfrom
skyegalaxy/graph-listener-lock-order-inversion-backport
Open

Fix lock order inversion between GraphListener and Context (ABI compatible backport)#3239
skyegalaxy wants to merge 1 commit into
jazzyfrom
skyegalaxy/graph-listener-lock-order-inversion-backport

Conversation

@skyegalaxy

Copy link
Copy Markdown
Member

Description

Avoids inverting lock order between GraphListener::start_if_not_started() and Context::shutdown() by registering the on_shutdown_callback before acquiring shutdown_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, throw GraphListenerShutdownError.)

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

Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
@ahcorde

ahcorde commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Pulls: #3239
Gist: https://gist.githubusercontent.com/ahcorde/cdfe067f549f8f6e89482a4ddd09cc85/raw/32b547e4b23285be7194f04b182a53ddce65107b/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20253

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde

ahcorde commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Pulls: #3239
Gist: https://gist.githubusercontent.com/ahcorde/5d650924dd7635401ed28093c5de55e2/raw/a5190c3b21b196af0eabc060498c51e09398651f/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: jazzy
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20257

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@skyegalaxy

Copy link
Copy Markdown
Member Author
  • Linux Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants