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

Aberta
#3,418 0 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@skyegalaxy já está trabalhando nisso.

Desde 17/11/2026.

  • #3427 de @aryankalantri — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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

Linguagem predominante
C++
Estrelas
829
Forks
587
Merge médio
4d 6h
PRs com merge (30d)
30

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de ros2/rclcpp

Todas as issues de ros2/rclcpp

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.