Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity #3415
So I noticed that the spin_some_doesnt_require_warmup* tests are skipped for EventsCBGExecutor, which I think would have caught this issue. I also did another scan with AI and found a few more tests that are disabled for EventsCBGExecutor. I will open a separate PR to enable them: https://github.com/ros2/rclcpp/pull/3416
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. |
<details><summary>✅ <code>libcomponent_manager.so</code> — full abidiff report</summary>
Compared:
lib-base/libcomponent_manager.solib-pr/libcomponent_manager.so @ 2a44dee(empty report — no differences printed by abidiff)
</details>
<details><summary>✅ <code>librclcpp.so</code> — full abidiff report</summary>
Compared:
lib-base/librclcpp.solib-pr/librclcpp.so @ 2a44dee(empty report — no differences printed by abidiff)
</details>
<details><summary>✅ <code>librclcpp_action.so</code> — full abidiff report</summary>
Compared:
lib-base/librclcpp_action.solib-pr/librclcpp_action.so @ 2a44dee(empty report — no differences printed by abidiff)
</details>
<details><summary>✅ <code>librclcpp_lifecycle.so</code> — full abidiff report</summary>
Compared:
lib-base/librclcpp_lifecycle.solib-pr/librclcpp_lifecycle.so @ 2a44dee(empty report — no differences printed by abidiff)
</details>
<sub>Updated for commit 2a44dee · check run · suppressions: /home/runner/work/_temp/ros2-abi-suppressions.txt</sub>
<!-- libabigail-action-marker:ros2-abi -->
Approved these changes.
Pulls: https://github.com/ros2/rclcpp/pull/3415
Gist: https://gist.githubusercontent.com/skyegalaxy/8f41f8f200303c6a2adda7cd08df6084/raw/77d80045f8b89ffbde75abff3ae399932cd01558/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/21125
Linux 
Linux-aarch64 
Linux-rhel 
Windows 
Approved these changes.
@MergifyIO backport jazzy kilted lyrical
backport jazzy kilted lyrical✅ Backports have been created
<details>
#3419 Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity (backport #3415) has been created for branch jazzy
#3420 Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity (backport #3415) has been created for branch kilted
#3421 Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity (backport #3415) has been created for branch lyrical</details>
skyegalaxy
mini-1235
Description
EventsCBGExecutor::spin_some()andspin_all(0)executed one ready entity per call, and an entity added after its callback group needed up to threespin_some()calls before it was served.Both changes are in
collect_and_execute_ready_events():max_durationof 0 now means no time limit, as inExecutor::spin_some_impl(). Before, the deadline wasstart + 0, so the loop stopped after the first entity.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, andspin_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, likerclcpp::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
<!--
If applicable, provide any additional context or details about the changes.
-->