fix(sandbox): serialize Docker recreation handoff - #8722
Conversation
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds restart-safe Docker sandbox creation handoff and stale Docker orphan cleanup. Ready handling can wait for client termination. Registry-only rebuilds remove exactly one labeled orphan before recreation and fail closed for ambiguous or unsuccessful cleanup. ChangesSandbox ownership recovery
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant OpenShellCreateClient
participant createStream
participant runSandboxCreateStep
OpenShellCreateClient->>createStream: report Ready
createStream->>OpenShellCreateClient: send SIGTERM
OpenShellCreateClient-->>createStream: close with status 143
createStream-->>runSandboxCreateStep: resolve forcedReady
sequenceDiagram
participant RebuildRecovery
participant removeStaleRebuildDockerOrphan
participant Docker
RebuildRecovery->>removeStaleRebuildDockerOrphan: remove sandbox orphan
removeStaleRebuildDockerOrphan->>Docker: query labeled containers
Docker-->>removeStaleRebuildDockerOrphan: return matches
removeStaleRebuildDockerOrphan->>Docker: force-remove one match
Docker-->>removeStaleRebuildDockerOrphan: confirm removal
removeStaleRebuildDockerOrphan-->>RebuildRecovery: complete cleanup
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
5 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
3 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests. 3 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. A maintainer can dispatch the default E2E suite against this exact revision. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Summary
Registry-only rebuild now removes one exactly labeled OpenShell Docker orphan before replacement creation and stops on ambiguous ownership. Restart-safe startup-command recreation now waits for the OpenShell create client to finish its ownership handoff before Docker cutover, preventing the replacement race that left sandboxes unready.
Related Issue
Fixes #8720
Changes
Type of Change
Quality Gates
docs/manage-sandboxes/recover-rebuild-sandboxes.mdx; it adds no command, flag, configuration, schema, policy, or user procedure.Documentation Writer Review
no-docs-neededdocs/manage-sandboxes/recover-rebuild-sandboxes.mdxalready documents registry-only recreation and fail-closed ownership behavior.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailabletest/rebuild-stale-recovery.test.tspassed 5/5 integration tests; after advisor-requested additions, the affected 3-file CLI slice passed 44/44 and the rebased orphan suite passed 13/13. CLI build and typecheck passed.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result: not applicable to this bounded two-branch lifecycle fix; repository checks, formatting, test-title, test-size, source-shape, and Vitest-project gates passed.npm run docsbuilds without warnings (doc changes only)The Docker-backed live E2E scenarios require a reachable Docker daemon and are left to normal required CI because Docker is unavailable on the local host.
Signed-off-by: Apurv Kumaria akumaria@nvidia.com