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

Fix: on_shutdown callback of controllers never get executed #1995

Merged

Conversation

Wiktor-99
Copy link
Contributor

As discussed with @christophfroehlich, I added a shutdown call instead of calling cleanup.

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.

@Wiktor-99 Looks good. Better not to add a new method only for this, just change it within the unload_controller method itself.

Can you add some tests?

Thank you

@Wiktor-99
Copy link
Contributor Author

@saikishor Why method shouldn't be added? Currently the unload_controller method is really long, it might improve readability.

About the test I see that some of them are failing, so fixing them will also cover new code.

@saikishor
Copy link
Member

@Wiktor-99 Sounds fair. Let's leave it like that.

@saikishor
Copy link
Member

About the test I see that some of them are failing, so fixing them will also cover new code.

Thank you

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.

I think it is missing a parenthesis

controller_manager/src/controller_manager.cpp Show resolved Hide resolved
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.

Project coverage is 89.27%. Comparing base (f4c9dd0) to head (6366451).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
controller_manager/src/controller_manager.cpp 50.00% 5 Missing and 1 partial ⚠️
...ith_interfaces/test_controller_with_interfaces.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1995      +/-   ##
==========================================
- Coverage   89.32%   89.27%   -0.05%     
==========================================
  Files         130      130              
  Lines       14522    14533      +11     
  Branches     1258     1257       -1     
==========================================
+ Hits        12972    12975       +3     
- Misses       1083     1092       +9     
+ Partials      467      466       -1     
Flag Coverage Δ
unittests 89.27% <63.63%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
.../include/controller_manager/controller_manager.hpp 100.00% <ø> (ø)
...r_manager/test/test_controller/test_controller.cpp 88.73% <100.00%> (+0.67%) ⬆️
...r_manager/test/test_controller/test_controller.hpp 100.00% <ø> (ø)
...ontroller_manager/test/test_controller_manager.cpp 96.10% <ø> (ø)
...ller_manager/test/test_controller_manager_srvs.cpp 99.26% <100.00%> (ø)
...ith_interfaces/test_controller_with_interfaces.hpp 100.00% <ø> (ø)
...ith_interfaces/test_controller_with_interfaces.cpp 66.66% <0.00%> (-13.34%) ⬇️
controller_manager/src/controller_manager.cpp 76.35% <50.00%> (+0.13%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM

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

@saikishor saikishor linked an issue Jan 12, 2025 that may be closed by this pull request
@christophfroehlich christophfroehlich changed the title Fix: on_shutdown callback of controllers never get executed #1987 Fix: on_shutdown callback of controllers never get executed Jan 12, 2025
@bmagyar bmagyar merged commit 2da1417 into ros-controls:master Jan 15, 2025
25 checks passed
@christophfroehlich
Copy link
Contributor

@bmagyar should we backport this to humble? The current behavior is wrong, but it might crash (badly configured) systems.

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.

on_shutdown callback of controllers never get executed
4 participants