← Back to Pull requests

[Humble] Fix isolated component manager shutdown hang #3282

Closed
unknown closed this pull request without merging on Sep 22, 2026 11:09 UTC
View on GitHub
unknown unknown commented on Sep 21, 2026 01:51 UTC
Author

Description

ComponentManagerIsolated::cancel_executor() currently waits indefinitely for
the dedicated executor to report that it is spinning.

During context shutdown, the executor thread may return from spin() before
the component manager is destroyed. In that state, is_spinning() remains
false permanently, so the shutdown path cannot leave the waiting loop. This
causes component_container_isolated to remain alive after SIGINT until the
launch system escalates to SIGTERM or SIGKILL.

This change also checks whether the component manager's ROS context is still
valid while waiting. If shutdown has already invalidated the context, the
method stops waiting and joins the executor thread.

This is an ABI-compatible Humble alternative to #2085. It does not add data
members, change public signatures, add virtual functions, or alter class
layout.

A regression test is included. It loads a real test component, shuts down the
ROS context, verifies that the dedicated executor thread has returned from
spin(), and then destroys the isolated component manager. Without the fix,
the test times out while destroying the manager.

Related to #2083.
Humble-compatible alternative to #2085.

Is this user-facing behavior change?

Yes. component_container_isolated can now terminate cleanly after SIGINT when
its dedicated executor threads have already stopped because the ROS context
was shut down. Previously, the process could hang until it was terminated by
SIGTERM or SIGKILL.

Did you use Generative AI?

Yes. OpenAI Codex (GPT-5) was used to assist with analyzing the shutdown race,
implementing the function-body-only fix, and drafting the regression test.
The resulting changes were reviewed and tested locally by the contributor.

Additional Information

Local verification:

  • The new regression test timed out against the original Humble implementation.

  • The same test passes with this change.

  • The regression test passed 20 consecutive runs.

  • Existing test_component_manager and test_component_manager_api tests pass.

  • copyright, cppcheck, cpplint, lint_cmake, uncrustify, and xmllint

  • checks pass.
  • git diff --check passes.
  • Diff: 279 lines (+209 / -70) across 3 files Reviewer: jmachowinski Review duration: 1997m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 279 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    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.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3282"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 17.1% · Safe to merge
    17.1%
    Repository