ros2 / ros2/rclcpp

MultiThreadedExecutor virtual run

Open
#2,157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • From sources
  • Version or commit hash:
    • Galactic and Humble
  • DDS implementation:
    • rmw_cyclonedds_cpp
  • Client library (if applicable):
    • rclcpp
Steps to reproduce issue

The multi-threaded executor declares the void run(size_t this_thread_number); method as protected but does not declares it as a virtual method. This prevents a child class from overriding the run method and prevents improving that method in a case by case basis.
For example, the current implementation is not exception safe which means that if an exception is thrown in the lower layer of rcl implementation (possibly at the rmw layer), the multithreaded executor thread might abnormally terminate since the exception is not handled.

Expected behavior

The run method should be override'able by a child class.

Actual behavior

The run method is not override'able by a child class.

Additional information

Feature request

Feature description
Implementation considerations

Contributor guide

Open the contributing guide

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.

Research direction

Start in rclcpp/include/rclcpp/executors/multi_threaded_executor.hpp at the protected run(size_t this_thread_number) declaration, then inspect its implementation in the corresponding executor source. Confirm how a child class currently interacts with run and define done as allowing that method to be overridden without changing unrelated executor behavior; the payload names no test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.