fix(vm): reclaim cancelled image preparation after worker exit - #4039
johntmyers merged 4 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pr-4039.docs.buildwithfern.com/openshell |
Run image preparation in an owned worker process, reserve its process identity until cleanup completes, and protect staging with leases so cancellation and recovery cannot race with another preparation attempt. Signed-off-by: Shiju <shiju@nvidia.com>
e6370a5 to
1627591
Compare
Merge the corrected workload-identity parent into the cleanup branch. Preserve the owned-worker cleanup changes while repairing inherited supervisor compilation. Signed-off-by: Shiju <shiju@nvidia.com>
drew
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
This PR is project-valid because it implements the accepted VM cleanup bug in #3953, but the initial review found one blocking concurrency regression. The worker ownership approach is sound in direction; the global lock boundaries need narrowing before runtime E2E dispatch.
Action required: @shiju-nv, limit shared-cache locking to cache miss/build/publication sections so an unrelated slow preparation cannot block cached sandbox starts or private overlay creation.
Blocking findings:
GATOR-2757ae7a-01: Full-lifetime global preparation locks serialize independent sandbox preparation.
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Implements accepted issue #3953 and is authored by a verified repository writer.
- Docs: No Fern update required; this changes internal VM preparation and the crate README documents the operational behavior.
- Checks: Current branch checks are green; required VM runtime E2E has not yet been dispatched.
- E2E:
test:e2ewill be required after review feedback is resolved. - Head SHA:
2757ae7a35cdf143bb7d96a2e77f7b526020c605 - Base SHA:
042bc23704c66cd8ed527ee50c509da3bdb6c531 - Merge base SHA:
042bc23704c66cd8ed527ee50c509da3bdb6c531 - Patch ID:
ce7c4c19fdc4d3e64a2a7c721df048d80ea54d12 - Gator payload:
10 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
Allow independent image and private overlay workers to progress concurrently. Serialize only destination checks and atomic cache publication, preserving worker cancellation ownership. Integrate inactive identity restoration. Signed-off-by: Shiju <shiju@nvidia.com>
|
Label |
drew
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The latest update resolves the prior concurrency blocker by removing the full-worker global locks, limiting serialization to shared-cache publication, and covering independent overlay progress with a regression test. No blocking findings remain, and the required runtime E2E workflow is running.
Blocking findings:
- No blocking findings remain
Carried findings:
GATOR-2757ae7a-01: resolved on this head; the Gator-owned review thread has been closed
Gator metadata
- Validation: Implements accepted VM cleanup issue #3953 and is authored by a verified repository writer.
- Docs: No Fern update required; this changes internal VM preparation behavior and updates the VM driver README.
- Checks: Branch checks, Helm lint, and Trivy are green; required E2E is in progress.
- E2E:
test:e2eis applied and the current-head workflow is running. - Head SHA:
6ed7c1a9c60c2bf76c1d56dc2236c55a2bed7cf3 - Base SHA:
fd1a801cfe025bb41c3a493797808baf674cc59e - Merge base SHA:
fd1a801cfe025bb41c3a493797808baf674cc59e - Patch ID:
36de8c962d9c43091542f076f0e17540fa074250 - Gator payload:
10 - Review mode:
follow_up - Previous reviewed SHA:
2757ae7a35cdf143bb7d96a2e77f7b526020c605 - Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:watch-pipeline
Integrate the identity parent correction while preserving cleanup behavior. Signed-off-by: Shiju <shiju@nvidia.com>
Maintainer Approval NeededGator validation and PR monitoring are complete. The current head is patch-equivalent to the reviewed head, the prior concurrency finding remains resolved, and all required checks are green. Review: No blocking findings remain. The required VM and external-driver E2E jobs passed. Human maintainer approval is now required. Gator metadata
|
Monitoring CompleteMonitoring is complete because this PR has merged. Final status: The reviewed implementation had no remaining blocking findings, required checks and VM E2E passed, and maintainer approval was present before merge. I removed the active Gator metadata
|
Summary
A timeout or cancellation can abort a sandbox's async preparation task while blocking filesystem work continues and temporary files remain. Run image and overlay preparation in an owned worker process. On cancellation, stop its process group and wait for cleanup before reclaiming files. Recover inactive attempts after driver restart.
Related Issue
Fixes #3953, accepted by a maintainer on 2026-09-30. Part of #3955. Depends on the workload-identity change in #4036.
Changes
EPERMcase.Testing
Local verification passed on the combined tree: formatting, diff and license checks, the VM driver package check, focused library regressions, and the actual-worker integration target. Tests prove a second sandbox progresses while another worker is blocked, cache publication preserves the first valid artifact, worker death releases the lock, and cancellation retains its cleanup guarantees. The two concurrency regressions fail with the original outer locks. This head includes the signed identity correction and durable stop/start E2E fixture from #4036. The inherited E2E crate matches its independently reviewed and compiled parent.
Current signed head:
ecf8d1973b79. Hosted verification: Branch Checks and Branch E2E Checks. Thetest:e2elabel is enabled for runtime tests.Hosted VM E2E runs on Linux. Fresh physical-Mac qualification remains pending.
Checklist