Don't throw an exception if removing a node not associated with any executor#3190
Don't throw an exception if removing a node not associated with any executor#3190skyegalaxy wants to merge 8 commits into
Conversation
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
|
Tick the box to add this pull request to the merge queue (same as
|
|
Pulls: #3190 |
fujitatomoya
left a comment
There was a problem hiding this comment.
i have 2 comments.
- should be also updated align with implementation.
rclcpp/rclcpp/include/rclcpp/executor.hpp
Line 224 in d031217
- normal Ctrl+C shutdown will now WARN-spam once per node, every time. the double-remove sequence is still deterministic though. either the coordination should also be fixed (e.g., ~ComponentManager skips nodes whose association flag is already clear, or EventsCBGExecutor's shutdown notifies/clears differently)? warning on every clean shutdown trains users to ignore warnings?
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
Signed-off-by: Skyler Medeiros <skye@polymathrobotics.com>
|
I appreciate your review and feedback @fujitatomoya ! I updated the docstrings here and also added a check in the component manager destructor for if the node's already associated with an executor before removing. That gets rid of the warning for the test case I added on my end. |
Description
This PR changes
remove_nodein bothexecutor_entities_collectorandevents_cbg_executorto warn the user that the node they're trying to remove isn't associated with the executor, instead of throwing an exception, as well as updating the existing tests.An exception will still be thrown if the user tries to remove a node associated with a DIFFERENT executor, as that would be an obvious programmer error. The behavior of
remove_nodeinEventsCBGExecutorhas been updated to mirror this behavior from the other executors.A regression test has also been added to
test_component_manager_apiin rclcpp_components, which asserts that an exception isn't thrown during the double-removal case as outlined in #3186Fixes #3186
Is this user-facing behavior change?
Did you use Generative AI?
Claude Opus 4.8
Additional Information