Repository navigation
fix(vibench): remove a released session's scratch files shielded - #6413
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. |
0e18a88 to
7c30750
Compare
584f72b to
1b16f8f
Compare
1b16f8f to
26a3dca
Compare
7c30750 to
0d0324f
Compare
26a3dca to
9814f47
Compare
0d0324f to
0aa8151
Compare
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM. No concerns found in the shielded cleanup or the disconnect regression test. I traced the release callers and shared cancellation contract. Failed stops still keep ownership for retry, while successful close drops the record and fences the session without another await.
Source inspection only. I did not execute tests.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
9814f47 to
a86139a
Compare
0aa8151 to
1de460e
Compare
hemildesai
left a comment
There was a problem hiding this comment.
SHIP
LGTM, no concerns. The stop already gets #6410's shield and bound, and this shields only the rmtree that follows, so the record is removed and the session fenced with no unshielded await left. It's the same pattern as #6411, with no double shielding. The new disconnect test drives a real anyio cancel scope against the fake provider.
The only red check is test_docker_compose.py::test_log_paths_exist_before_the_command_hooks_and_healthcheck_and_a_foreign_target_is_linked in Sandbox tests. This PR touches only vibench and that test passes on #6410–#6412, so I've re-run it. I'll approve once it's green.
1de460e to
c8b292c
Compare
a86139a to
6905e65
Compare
c8b292c to
5131416
Compare
6905e65 to
25ad956
Compare
25ad956 to
b4240bb
Compare
5131416 to
3c6f2b6
Compare
b4240bb to
b1cd701
Compare
3c6f2b6 to
bb422bb
Compare
hemildesai
left a comment
There was a problem hiding this comment.
Approving at b1cd701. The patch is unchanged from the version I reviewed, now rebased, and CI is green.
vibench's release stops the session's build sandbox and then removes its scratch files. The stop is shielded and bounded by AsyncSandbox.stop, but a client that disconnects still cancelled the removal after it, so the close returned before it dropped the session's record and fenced it. The removal is now shielded like the stop, so a close cut short by a disconnect still removes the scratch files and then, with no await left, drops the record and fences the session. Signed-off-by: Ananth Subramaniam <[email protected]>
bb422bb to
1e19e37
Compare
b1cd701 to
bb5d8f3
Compare
What does this PR do?
vibench's release stops the session's build sandbox and then removes its scratch files. The stop is shielded and bounded by
AsyncSandbox.stop(#6410), but a client that disconnects still cancelled the removal after it, so the close returned before it dropped the session's record and fenced it.The removal is now shielded like the stop, so a close cut short by a disconnect still removes the scratch files and then, with no await left, drops the record and fences the session. A thread running
rmtreecannot be cancelled anyway, so the removal has no time limit of its own.The harbor, partner_if and scale_swe stops this PR used to move need no change now that
stop()itself is shielded and bounded.How it works
flowchart LR subgraph before["Before"] direction TB a1["close, client disconnects"] --> a2["stop the build sandbox, shielded"] a2 --> a3["remove scratch files: cancelled"] a3 --> a4["close ends before it drops the record<br/>and fences the session"] end subgraph after["After"] direction TB b1["close, client disconnects"] --> b2["stop the build sandbox, shielded"] b2 --> b3["remove scratch files, shielded"] b3 --> b4["drop the record and fence the session,<br/>with no await left to cancel"] end before ~~~ afterWhere this sits in the stack
This is one PR in a stack of PRs that implement Milestone 1 of the sandbox ownership design: every sandbox has one owner, the server that starts it, which stops it on every path, and every other user borrows it. Each PR is one commit, so each diff shows only that PR's change.
maindirectly.mainwhen it resumes.The highlighted box is this PR.
ananthsub/sandbox-stop-keep-record): fix(interactive_browser): drop a browser's record only after it closesananthsub/sandbox-stop-retried-owners): fix(vibench): remove a released session's scratch files shielded (this PR)ananthsub/owned-sandboxes): feat(sandbox): make the sandbox checkpointer the public OwnedSandboxesananthsub/owned-sandboxes-lifecycle): feat(sandbox): stop, start and export owned sandboxes safely under loadananthsub/owned-sandboxes-network): feat(sandbox): typed network rule and provider capabilities for ownersananthsub/sandbox-borrow): feat(agents): borrow lent sandboxes and type the agent's own sandboxValidation
pre-commit run --files <changed files>on the unit's diff (ruff, ruff-format, import-linter, guardwords).pytest -n 16 tests/unit_tests, in a venv with CI's extras, with the same failures as onmain.Rollouts
N/A: a normal close is the same; only cancellation behavior changes.
Compatibility and benchmark impact
None.
Checklist
git commit -s).