← Back to Pull requests

ateworker-gvisor: simplify container cleanup #4199

Open
sfunkenhauser opened this pull request with 230 lines diff across 7 files
View on GitHub
sfunkenhauser sfunkenhauser commented on Nov 27, 2026 16:30 UTC
Author

Run and Restore failures, Terminate, checkpoint, and crash teardown all clean up with teardownContainers, without stopping containers first. The runsc delete -force it runs skips containers that don't exist, and kills and waits for every process in those that do, so tracking created containers and the separate kill and wait calls were redundant.

Fixes #4198

AI use: AI-assisted, I reviewed and tested it.

  • Tests pass

  • Docs updated
  • Diff: 230 lines (+42 / -188) across 7 files Reviewer: EtiennePerot Review duration: 5231m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.44) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 230 lines diff across 7 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.84 · 2 substantive comment(s)
    0.84
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    88%
    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.326
    Real PR Conversation Timeline
    4 items
    EtiennePerot EtiennePerot commented on code on Nov 27, 2026 22:22 UTC
    Code Review
    cmd/ateworker-gvisor/main.go:1
    @@ -957,7 +951,7 @@ func (s *AteWorkerService) CheckpointWorkload(ctx context.Context, req *ateworke
     				timing.checkpoint = lap(&tLast)
     				return fmt.Errorf("while checkpointing the sandbox: %w", err)
     			}
    -			sandboxExited = waitSandboxExited(ctx, sandbox)
    +			waitSandboxExited(ctx, sandbox)

    This wait can go away after Substrate's gVisor version includes https://github.com/gvisor/gvisor/pull/17781, saving some time on the checkpoint path. That's not the case yet, so this PR isn't the right time to remove it, but please add a comment here stating that this wait should be removed once https://github.com/gvisor/gvisor/pull/17781 is in Substrate's gVisor version.

    EtiennePerot EtiennePerot requested changes on Nov 27, 2026 22:22 UTC
    Changes Requested Reviewer

    Requested changes.

    sfunkenhauser sfunkenhauser commented on code on Nov 30, 2026 17:52 UTC
    Code Review
    cmd/ateworker-gvisor/main.go:1
    @@ -957,7 +951,7 @@ func (s *AteWorkerService) CheckpointWorkload(ctx context.Context, req *ateworke
     				timing.checkpoint = lap(&tLast)
     				return fmt.Errorf("while checkpointing the sandbox: %w", err)
     			}
    -			sandboxExited = waitSandboxExited(ctx, sandbox)
    +			waitSandboxExited(ctx, sandbox)

    Done.

    Reviewers
    Assignees
    sfunkenhauser sfunkenhauser
    Labels
    risk: low confidence: 88.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: 44.4% (MEDIUM) · Higher = larger blast radius
    44.4%
    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: 88.8% · Lower = rushed or shallow review
    88.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: 5.0% · Safe to merge
    5.0%