Skip to content

Fix shutdown callback leak in wait_for_message - #3358

Open
ahcorde wants to merge 1 commit into
rollingfrom
ahcorde/rolling/fix_wait_for_message_shutdown_callback_leak
Open

ahcorde wants to merge 1 commit into
rollingfrom
ahcorde/rolling/fix_wait_for_message_shutdown_callback_leak

Conversation

@ahcorde

@ahcorde ahcorde commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Description

rclcpp::wait_for_message registers an on-shutdown callback on the context to wake up the wait set, but never removes it. Every call leaves one more callback registered until the context shuts down.

  • Remove the callback with RCPPUTILS_SCOPE_EXIT, the same way the subscription is already removed from the wait set.
  • Add a regression test that checks the number of shutdown callbacks doesn't grow across calls

Did you use Generative AI?

Claude Opus 5.5

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Oct 16, 2026
@github-actions

Copy link
Copy Markdown

ABI Compliance Check

✅ Verdict: compatible

Library Verdict Summary
libcomponent_manager.so ✅ compatible No ABI changes detected.
librclcpp.so ✅ compatible No ABI changes detected.
librclcpp_action.so ✅ compatible No ABI changes detected.
librclcpp_lifecycle.so ✅ compatible No ABI changes detected.
✅ libcomponent_manager.so — full abidiff report

Compared:

  • Base: lib-base/libcomponent_manager.so
  • Head: lib-pr/libcomponent_manager.so @ 0f6b6fb
(empty report — no differences printed by abidiff)
✅ librclcpp.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp.so
  • Head: lib-pr/librclcpp.so @ 0f6b6fb
Functions changes summary: 0 Removed (41 filtered out), 0 Changed (79 filtered out), 0 Added (19 filtered out) functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable


✅ librclcpp_action.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_action.so
  • Head: lib-pr/librclcpp_action.so @ 0f6b6fb
(empty report — no differences printed by abidiff)
✅ librclcpp_lifecycle.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_lifecycle.so
  • Head: lib-pr/librclcpp_lifecycle.so @ 0f6b6fb
(empty report — no differences printed by abidiff)

Updated for commit 0f6b6fb · check run · suppressions: /home/runner/work/_temp/ros2-abi-suppressions.txt

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant