Repository navigation
Fix EventsCBGExecutor spin_some and spin_all(0) executing only one entity (backport #3415) - #3420
Open
mergify[bot] wants to merge 2 commits into
Open
mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
…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)
ABI Compliance Check✅ Verdict: compatible
✅
|
Member
|
Pulls: #3420 |
skyegalaxy
approved these changes
Nov 17, 2026
Contributor
ahcorde
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
This is an automatic backport of pull request #3415 done by [Mergify](https://mergify.com).