Skip to content

Enforce cleanup_controller on more exit points of configure_controller#3192

Merged
bmagyar merged 3 commits into
ros-controls:masterfrom
vectorcrumb:fix/cleanup-of-chainable-controllers
May 25, 2026
Merged

Enforce cleanup_controller on more exit points of configure_controller#3192
bmagyar merged 3 commits into
ros-controls:masterfrom
vectorcrumb:fix/cleanup-of-chainable-controllers

Conversation

@vectorcrumb

@vectorcrumb vectorcrumb commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Two of the possible early return paths on controller_manager::configure_controller led to controllers being left in an INACTIVE state instead of rolling back to the UNCONFIGURED state. This specifically affected controllers that were chainable that:

  • didn't export any state nor reference interfaces
  • raised an exception while querying their state/reference interfaces

Two tests were added to the controller_manager/test_cleanup_controller test suite for these cases.

This PR should solve #3153


To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

@codecov

codecov Bot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.10%. Comparing base (bb07fdd) to head (99b5dbf).

Files with missing lines Patch % Lines
...ontroller_manager/test/test_cleanup_controller.cpp 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3192      +/-   ##
==========================================
- Coverage   89.12%   89.10%   -0.03%     
==========================================
  Files         158      158              
  Lines       19587    19601      +14     
  Branches     1589     1590       +1     
==========================================
+ Hits        17457    17465       +8     
- Misses       1471     1476       +5     
- Partials      659      660       +1     
Flag Coverage Δ
unittests 89.10% <85.71%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
controller_manager/src/controller_manager.cpp 75.85% <100.00%> (-0.27%) ⬇️
...ontroller_manager/test/test_cleanup_controller.cpp 94.59% <83.33%> (-5.41%) ⬇️

... and 1 file with indirect coverage changes

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

@vectorcrumb

Copy link
Copy Markdown
Contributor Author

Hi, I have some tests failing due to timing issues, could somebody lend me a hand?

@christophfroehlich

Copy link
Copy Markdown
Member

Hi, I have some tests failing due to timing issues, could somebody lend me a hand?

These are known flaky tests and not related, don't worry.

@vectorcrumb

Copy link
Copy Markdown
Contributor Author

These are known flaky tests and not related, don't worry.

Understood, thanks! Anything else I should be doing (eg reaching out to people some channel)? I didn't find any discord or similar in the contribution guide.

@christophfroehlich

Copy link
Copy Markdown
Member

There is no need to tag anyone, we will come back when we will have time. You always can help in reviewing one of the many other open PRs ;)

@saikishor saikishor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rest LGTM. Just one minor nit in the tests

Comment thread controller_manager/test/test_cleanup_controller.cpp
@vectorcrumb vectorcrumb force-pushed the fix/cleanup-of-chainable-controllers branch from 99b5dbf to 4499776 Compare April 11, 2026 22:44
Two of the possible early return paths on controller_manager::configure_controller
led to controllers being left in an INACTIVE state instead of rolling back to the
UNCONFIGURED state. This specifically affected controllers that were chainable
that:

- didn't export any state nor reference interfaces
- raised an exception while querying their state/reference interfaces

Two tests were added to the controller_manager/test_cleanup_controller test
suite for these cases.
@vectorcrumb vectorcrumb force-pushed the fix/cleanup-of-chainable-controllers branch from 4499776 to 369c53c Compare April 11, 2026 22:46
@vectorcrumb vectorcrumb requested a review from saikishor April 12, 2026 19:38
saikishor
saikishor previously approved these changes Apr 12, 2026

@saikishor saikishor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

P.S. Do not force push the PRs again, this makes the maintainers to review all the codebase again. Moreover, we will squash the commits

@vectorcrumb

Copy link
Copy Markdown
Contributor Author

Got it, I'll refrain from doing that. What if I want to rebase on top of master though? Do you need anything else from my side to get this merged? Thanks for the feedback!

@saikishor

Copy link
Copy Markdown
Member

Got it, I'll refrain from doing that. What if I want to rebase on top of master though? Do you need anything else from my side to get this merged? Thanks for the feedback!

You can just sync those commits using the GitHub UI from your fork or from the PR

@christophfroehlich

Copy link
Copy Markdown
Member

Got it, I'll refrain from doing that. What if I want to rebase on top of master though? Do you need anything else from my side to get this merged? Thanks for the feedback!

You can just sync those commits using the GitHub UI from your fork or from the PR

  • using merge strategy instead of rebase

bmagyar
bmagyar previously approved these changes May 25, 2026

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please fix the failing pre-commit job, I suggest to install pre-commit permanently in this repo.

@bmagyar bmagyar dismissed stale reviews from saikishor and themself via 025d259 May 25, 2026 12:38
@bmagyar bmagyar added backport-jazzy Triggers PR backport to ROS 2 jazzy. backport-kilted Triggers PR backport to ROS 2 kilted. labels May 25, 2026
@bmagyar bmagyar merged commit 17aadfb into ros-controls:master May 25, 2026
19 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-jazzy Triggers PR backport to ROS 2 jazzy. backport-kilted Triggers PR backport to ROS 2 kilted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure_controller error path causes controller manager to hang for invalid chainable controllers

4 participants