← Back to Pull requests

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

Merged
mini-1235 merged 3 files (84 lines) on Nov 17, 2026 00:16 UTC
View on GitHub
mini-1235 mini-1235 commented on Nov 16, 2026 16:42 UTC
Author

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

    <!--
    If applicable, provide any additional context or details about the changes.
    -->

    Diff: 84 lines (+78 / -6) across 3 files Reviewer: skyegalaxy Review duration: 454m
    All Vouch review confidence checks passed
    Residual risk 0.10 = Change Risk (0.33) × (1 − Review Confidence (0.69)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 84 lines diff across 3 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.56 · 5 substantive comment(s)
    0.56
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    68%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.266
    Real PR Conversation Timeline
    8 items
    mini-1235 mini-1235 commented on Nov 16, 2026 16:51 UTC
    Author

    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

    github-actions[bot] github-actions[bot] commented on Nov 16, 2026 16:59 UTC
    Bot

    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:

  • Base: lib-base/libcomponent_manager.so

  • Head: lib-pr/libcomponent_manager.so @ 2a44dee
  • (empty report — no differences printed by abidiff)
    

    </details>

    <details><summary>✅ <code>librclcpp.so</code> — full abidiff report</summary>

    Compared:

  • Base: lib-base/librclcpp.so

  • Head: lib-pr/librclcpp.so @ 2a44dee
  • (empty report — no differences printed by abidiff)
    

    </details>

    <details><summary>✅ <code>librclcpp_action.so</code> — full abidiff report</summary>

    Compared:

  • Base: lib-base/librclcpp_action.so

  • Head: lib-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:

  • Base: lib-base/librclcpp_lifecycle.so

  • Head: lib-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 -->

    skyegalaxy skyegalaxy approved these changes on Nov 16, 2026 18:38 UTC
    Approved Reviewer

    Approved these changes.

    mjcarroll mjcarroll approved these changes on Nov 16, 2026 18:56 UTC
    Approved Reviewer

    Approved these changes.

    skyegalaxy skyegalaxy commented on Nov 17, 2026 22:18 UTC
    Contributor

    @MergifyIO backport jazzy kilted lyrical

    mergify[bot] mergify[bot] commented on Nov 17, 2026 22:18 UTC
    Bot
    Reviewers
    Assignees
    mini-1235 mini-1235
    Labels
    risk: low confidence: 68.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.5% (LOW) · Higher = larger blast radius
    32.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 68.7% · Lower = rushed or shallow review
    68.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 10.2% · Safe to merge
    10.2%
    Repository