removing and immediately re-adding a node to the EventsCBGExecutor leaves its entities unregistered

Open
#3,418 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@skyegalaxy is already working on this.

Since Nov 17, 2026.

  • #3427 by @aryankalantri — open

Assessment

This issue has not been assessed yet.

Description

bug
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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/rclcpp

All issues in ros2/rclcpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.