removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregistered
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Generated by Generative AI
Found using Claude Opus 5.5
Operating System:
Ubuntu 26.04 (x86_64) (inside a rolling developer container)
ROS version or commit hash:
rolling 917c1240
RMW implementation (if applicable):
rmw_fastrtps_cpp
RMW Configuration (if applicable):
No response
Client library (if applicable):
rclcpp
'ros2 doctor --report' output
ros2 doctor --report
<COPY OUTPUT HERE>
Steps to reproduce issue
Spin an EventsCBGExecutor, then call remove_node(node) immediately followed by add_node(node):
rclcpp::executors::EventsCBGExecutor executor(rclcpp::ExecutorOptions(), 2);
auto node = std::make_shared<rclcpp::Node>("n");
auto timer = node->create_wall_timer(5ms, [&]() {timer_calls++;});
auto sub = node->create_subscription<std_msgs::msg::Empty>("t", 10, [&](auto) {sub_calls++;});
executor.add_node(node);
std::thread spin([&]() {executor.spin();});
// ... timer and subscription are running ...
executor.remove_node(node);
executor.add_node(node);
// timer_calls and sub_calls never increase again
Reproducer gist here: https://gist.github.com/skyegalaxy/715297510b38d222035c960c3c66f60d
Expected behavior
After add_node() the node's timer, subscription, and other entities run again, as they do with the
SingleThreadedExecutor and the MultiThreadedExecutor.
Actual behavior
None of the node's entities run again. The timer never fires and the subscription never receives a message.
With a 30 ms pause between remove_node() and add_node(), everything works again.
Additional information
No response
- Dominant language
- C++
- Stars
- 829
- Forks
- 587
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 30
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/rclcpp
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Memory grows per callback group created and destroyed on long lived nodesPossibly taken @jwallace42 claimed this 1 day ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 28/100
ros2/rclcpp#3428 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[Humble] Removing a node with more than one auto-added callback group leaves a dangling guard condition in the executorPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 55/100
ros2/rclcpp#3410 · 2 comments ·
Maintainers usually reply within 1 day
-
Copy constructor exception leaks intra-process message allocationPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
EchoTools/nevr-runtime#2912 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
bug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
libc++
Difficulty 1/5 Under an hour Newbie friendliness 88/100
llvm/llvm-project#246508 ·
Maintainers usually reply within 1 day