Skip to content

nav2_lifecycle_manager: remove rcl preshutdown callback on destruction (backport #6721) - #6741

Merged
SteveMacenski merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-6721
Nov 3, 2026
Merged

SteveMacenski merged 1 commit into
lyricalfrom
mergify/bp/lyrical/pr-6721

Conversation

@mergify

@mergify mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

when Ros2 is sutting down , it inform the Lifecycle manager for stop and manage diff. mavation nodes .
the change has been made following :

Stage Original code Modified code
Lifecycle Manager starts Registers callback Registers callback and saves handle
Nav2 runs Callback is available Callback is available
Lifecycle Manager is destroyed Callback remains registered Callback is unregistered
ROS 2 context shuts down later Stale callback can cause a crash Stale callback has been removed


This is an automatic backport of pull request #6721 done by Mergify.

#6721)

Store the PreShutdownCallbackHandle and remove the callback in ~LifecycleManager(), as nav2_util::LifecycleNode does. Fixes a segfault on shutdown when the lifecycle manager is composed in a component container (#6690).

Signed-off-by: Anirban Bhattacharyya <62070825+anirban2190@users.noreply.github.com>
(cherry picked from commit c882888)
@mergify

mergify Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@mergify[bot], all pull requests must be targeted towards the main development branch.
Once merged into main, it is possible to backport to @lyrical, but it must be in main
to have these changes reflected into new distributions.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
nav2_lifecycle_manager/src/lifecycle_manager.cpp 90.10% <100.00%> (-0.26%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SteveMacenski
SteveMacenski merged commit 6ea4c76 into lyrical Nov 3, 2026
15 of 16 checks passed
@SteveMacenski
SteveMacenski deleted the mergify/bp/lyrical/pr-6721 branch November 3, 2026 18:46
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