Skip to content

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

@Anusha-Sharma-2

Description

@Anusha-Sharma-2

Describe the bug
When configuring a chainable controller that does not export any state or reference interfaces, configure_controller() returns ERROR as expected, but the controller manager does not terminate cleanly and remains active, causing tests or processes to hang indefinitely.

To Reproduce
Steps to reproduce the behavior:

  1. Create a chainable controller that exports no state or reference interfaces
  2. Add it to the controller manager
  3. Initialize the resource manager
  4. Call configure_controller
  5. Observe that ERROR is returned and logged correctly, however the process/test does not terminate and hangs unless interrupted

Example:

// Minimal reproduction (adapted from existing test patterns)
auto bad_controller =
  std::make_shared<test_chainable_controller::TestChainableController>();

cm_->add_controller(
  bad_controller,
  "bad_chainable_controller",
  test_chainable_controller::TEST_CONTROLLER_CLASS_NAME);

pass_robot_description_to_cm_and_rm();

auto ret = cm_->configure_controller("bad_chainable_controller");

Expected: ERROR
Actual: returns ERROR but system does not terminate cleanly

Expected behavior
After returning ERROR, the controller manager should:

  • fully exit or roll back the configuration lifecycle transition
  • not leave the system in an active/spinning state
  • allow tests or processes to terminate normally

Screenshots
N/A (logs below)

[INFO] Configuring controller: 'bad_chainable_controller'
[ERROR] Controller 'bad_chainable_controller' is chainable, but does not export any state or reference interfaces
(hangs)

Environment (please complete the following information):

  • OS: Ubuntu 24.04
  • ROS 2 Version: Rolling
  • Workspace: local build of ros2_control
  • No modifications to core logic (issue observed while adding test coverage)

Additional context
Add any other context about the problem here, especially include any modifications to ros2_control that relate to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions