Skip to content

feat: Added check for double usage of entities in rcl_waitset#1206

Merged
jmachowinski merged 1 commit intoros2:rollingfrom
cellumation:check_for_duplicated_entities
Apr 20, 2026
Merged

feat: Added check for double usage of entities in rcl_waitset#1206
jmachowinski merged 1 commit intoros2:rollingfrom
cellumation:check_for_duplicated_entities

Conversation

@jmachowinski
Copy link
Copy Markdown
Contributor

Adding entities twice to a waitset is not allowed, and will introduce subtle bugs. Therefore the rcl_wait function will not explicitly check for duplicated entries in the waitset.

@wjwwood @mjcarroll @alsora This commit adds the check that we agreed on in the last client workgroup meeting

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch 3 times, most recently from f2041ac to 13ad17c Compare January 17, 2025 19:08
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/75562e3c9dd95204212810eff089a23e/raw/9813cf1dddd5efd5fb3ad11d7b432b8880f45ebd/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15195

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from 13ad17c to 53a0d40 Compare February 17, 2025 09:23
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/a1610420370b149cc98a22cbf6f19c8c/raw/9813cf1dddd5efd5fb3ad11d7b432b8880f45ebd/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15203

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from 53a0d40 to 1cdb729 Compare February 17, 2025 12:47
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/84c64ce2e17e4c2926602a6b879b4654/raw/9813cf1dddd5efd5fb3ad11d7b432b8880f45ebd/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15208

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@jmachowinski
Copy link
Copy Markdown
Contributor Author

This need to be merged after ros2/rclcpp#2714, as this contains the fix for the two identical guard conditions added by the executor.

@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/9ba939d7e6f462f79c660af54e56ce56/raw/9813cf1dddd5efd5fb3ad11d7b432b8880f45ebd/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15225

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI.

Comment thread rcl/src/rcl/wait.c
@fujitatomoya
Copy link
Copy Markdown
Collaborator

https://ci.ros2.org/job/ci_windows/23361/testReport/junit/(root)/test_launch_ros/pytest_missing_result/ is unrelated.

@jmachowinski if you want to wait for more reviews on this, please do that. i will leave this to you.

Comment thread rcl/src/rcl/wait.c
@alsora
Copy link
Copy Markdown
Contributor

alsora commented Mar 1, 2025

Besides the minor request to add a comment, could we have a unit-test for this?
Then the PR would be ready to merge IMO

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from 1cdb729 to d1f6983 Compare March 11, 2025 10:37
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Added a test case for duplicate timer and duplicate guard condition. I didn't add tests for subscribers and services, as the boilerplate for setup would be a bit much and it would check the identical code path.

Copy link
Copy Markdown
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and addresses @alsora's request.

One more CI and we are good to go here?

@alsora
Copy link
Copy Markdown
Contributor

alsora commented Mar 13, 2025

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from d1f6983 to ae7e9a3 Compare March 13, 2025 14:43
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/313bac2cf0368d362a8f4c204f8eaac4/raw/9813cf1dddd5efd5fb3ad11d7b432b8880f45ebd/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15365

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Copy Markdown
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind to merge with rolling?

@fujitatomoya
Copy link
Copy Markdown
Collaborator

@Mergifyio rebase

@mergify
Copy link
Copy Markdown

mergify Bot commented Oct 2, 2025

rebase

❌ Pull request can't be updated with latest base branch changes

Details

Mergify needs the author permission to update the base branch of the pull request.
@jmachowinski needs to authorize modification on its head branch.

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Nov 6, 2025

@jmachowinski Do you mind to merge with rolling?

@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from ae7e9a3 to e5479e2 Compare November 24, 2025 15:19
@jmachowinski
Copy link
Copy Markdown
Contributor Author

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/cefd44fd73da75d97b83ffcbbf310e78/raw/5e77b5f58a8799938ececf247ecd30dc74004d2e/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17589

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Adding entities twice to a waitset is not allowed, and will introduce
subtle bugs. Therefore the rcl_wait function will not explicitly check
for duplicated entries in the waitset.

Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
@jmachowinski jmachowinski force-pushed the check_for_duplicated_entities branch from e5479e2 to d78998f Compare April 20, 2026 15:39
@jmachowinski
Copy link
Copy Markdown
Contributor Author

jmachowinski commented Apr 20, 2026

Pulls: #1206
Gist: https://gist.githubusercontent.com/jmachowinski/503b60131e6f9ec510245a1d6239e7a9/raw/4c94cc07c3913868c3a972184129a47ad5b44a42/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/19018

  • Linux Build Status

  • Linux-aarch64 Build Status

  • Linux-rhel Build Status

  • Windows Build Status

  • Linux Build Status

@jmachowinski jmachowinski merged commit 913d2e1 into ros2:rolling Apr 20, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Kilted Kaiju Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants