Skip to content

Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity (backport #3415) - #3419

Open
mergify[bot] wants to merge 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-3415
Open

mergify[bot] wants to merge 2 commits into
jazzyfrom
mergify/bp/jazzy/pr-3415

Conversation

@mergify

@mergify mergify Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Description

EventsCBGExecutor::spin_some() and spin_all(0) executed one ready entity per call, and an entity added after its callback group needed up to three spin_some() calls before it was served.

Both changes are in collect_and_execute_ready_events():

  • A max_duration of 0 now means no time limit, as in Executor::spin_some_impl(). Before, the deadline was start + 0, so the loop stopped after the first entity.
  • If the executed work requested a callback group resync, spin_some() resyncs and collects once more instead of returning. Before, the resync only ran at the start of the next call.

Fixes #3414

Is this user-facing behavior change?

Yes. One spin_some() call now executes all events that were ready when it was called, and spin_all(0) runs until no work is left.

spin_some() can execute the same entity several times in one call, once per event that was queued at the start, like rclcpp::experimental::executors::EventsExecutor. The wait-set executors execute an entity once per call.

Did you use Generative AI?

Yes, Claude Fable 5.2

Additional Information


This is an automatic backport of pull request #3415 done by [Mergify](https://mergify.com).

…tity (#3415)

collect_and_execute_ready_events() computed the deadline as
start + max_duration. With a max_duration of 0, which means no limit, the
deadline had already passed, so spin_some() and spin_all(0) returned after
the first executed entity. Treat 0 as no time limit, as
Executor::spin_some_impl() does.

An entity that was added after its callback group needed up to three
spin_some() calls before it was served: executing the notify guard
condition event requests the sync, executing the sync function only sets
needs_callback_group_resync, and the resync ran at the start of the next
call. If the executed work requested a resync, resync and collect once
more instead of returning.

Add a test that several ready waitables are all executed by one
spin_some() and one spin_all(0), and enable the spin_some warm-up tests
for the EventsCBGExecutor.

Signed-off-by: mini-1235 <mauricepurnawan@gmail.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 2424b75)
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

ABI Compliance Check

✅ Verdict: compatible

Library Verdict Summary
libcomponent_manager.so ✅ compatible No ABI changes detected.
librclcpp.so ✅ compatible No ABI changes detected.
librclcpp_action.so ✅ compatible No ABI changes detected.
librclcpp_lifecycle.so ✅ compatible No ABI changes detected.
✅ libcomponent_manager.so — full abidiff report

Compared:

  • Base: lib-base/libcomponent_manager.so
  • Head: lib-pr/libcomponent_manager.so @ 7eeb69e
(empty report — no differences printed by abidiff)
✅ librclcpp.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp.so
  • Head: lib-pr/librclcpp.so @ 7eeb69e
Functions changes summary: 0 Removed (3 filtered out), 0 Changed (113 filtered out), 0 Added (1 filtered out) functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable


✅ librclcpp_action.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_action.so
  • Head: lib-pr/librclcpp_action.so @ 7eeb69e
(empty report — no differences printed by abidiff)
✅ librclcpp_lifecycle.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_lifecycle.so
  • Head: lib-pr/librclcpp_lifecycle.so @ 7eeb69e
(empty report — no differences printed by abidiff)

Updated for commit 7eeb69e · check run · suppressions: /home/runner/work/_temp/ros2-abi-suppressions.txt

@skyegalaxy

Copy link
Copy Markdown
Member

Pulls: #3419
Gist: https://gist.githubusercontent.com/skyegalaxy/a5d71d2ad04cfb8a7bdd71eb123cb333/raw/90bb115049d98a8fc4644fd13d0b351303238065/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: jazzy
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/21150

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

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde

ahcorde commented Nov 19, 2026

Copy link
Copy Markdown
Contributor
  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants