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

未关闭
#3,418 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@skyegalaxy 已经在做这个了。

开始于 2026年11月17日。

  • #3427 来自 @aryankalantri —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

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

主要语言
C++
星标
829
派生
587
平均合并
4 天 6 小时
30 天内合并 PR
30

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ros2/rclcpp 的其他 Issue

查看 ros2/rclcpp 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。