Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger shutdown transition in destructor #1979

Merged
merged 11 commits into from
Jan 9, 2025
Merged

Trigger shutdown transition in destructor #1979

merged 11 commits into from
Jan 9, 2025

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Jan 5, 2025

Since ros2/rclcpp#2562 we get lots of warnings in the test logs like

[WARN] [1735845337.264023881] [rclcpp_lifecycle]: LifecycleNode is not shut down: Node still in state(1) in destructor

I think we can just trigger the shutdown transition in the destructor of the base class.

We still had some warnings in tests of this repo when rclcpp::shutdown() is called before the node is destructed, and the context is invalid. The transition then would fail without the rclcpp::ok() check.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.30%. Comparing base (6e1059c) to head (4ae7e79).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1979      +/-   ##
==========================================
+ Coverage   89.26%   89.30%   +0.04%     
==========================================
  Files         130      130              
  Lines       14493    14516      +23     
  Branches     1257     1258       +1     
==========================================
+ Hits        12937    12964      +27     
+ Misses       1088     1084       -4     
  Partials      468      468              
Flag Coverage Δ
unittests 89.30% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...controller_interface/controller_interface_base.hpp 91.66% <ø> (-0.65%) ⬇️
...roller_interface/src/controller_interface_base.cpp 87.73% <100.00%> (+5.26%) ⬆️
...oller_interface/test/test_controller_interface.cpp 100.00% <100.00%> (ø)
...er_interface/test/test_controller_with_options.cpp 100.00% <100.00%> (ø)
joint_limits/test/joint_limits_rosparam_test.cpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@christophfroehlich christophfroehlich changed the title Trigger shutdown transition in destructor Trigger shutdown transition in destructor/context_shutdown Jan 6, 2025
@christophfroehlich christophfroehlich marked this pull request as draft January 7, 2025 16:57
@christophfroehlich christophfroehlich changed the title Trigger shutdown transition in destructor/context_shutdown Trigger shutdown transition in destructor Jan 7, 2025
@christophfroehlich christophfroehlich marked this pull request as ready for review January 7, 2025 20:39
saikishor
saikishor previously approved these changes Jan 7, 2025
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot requested review from ARK3r and bmagyar January 7, 2025 20:48
@bmagyar bmagyar merged commit b329679 into master Jan 9, 2025
25 checks passed
@bmagyar bmagyar deleted the fix/shutdown branch January 9, 2025 08:05
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.

3 participants