Repository navigation
fix(gdpval): keep a failed seed's sandbox until a stop succeeds - #6411
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. |
0c508c8 to
ff939b5
Compare
ff2e211 to
4886429
Compare
ff939b5 to
6ae610b
Compare
4886429 to
77078c1
Compare
77078c1 to
bd640ef
Compare
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
One RISK: retained failed seeds bypass episode/task ownership checks, so a conflicting request can stop and replace their sandbox or fence the session for another episode.
I reviewed all three changed files and traced the affected session, staging and cancellation paths. Validation was static; I did not execute tests.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
bd640ef to
ec990ad
Compare
0bac6ac to
bba82a9
Compare
hemildesai
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
This uses #6410 correctly. It doesn't re-shield the stop; it shields only the rmtree afterwards, which #6410 doesn't cover. Splitting out stage_reference_files means the session owns the sandbox before the upload. A failed release keeps the session in _failed_seeds, and the entry is popped only after a stop succeeds, which matches AGENTS.md. start_task_sandbox has no other callers, so dropping its reference args is safe. The gdpval session tests pass locally (54 passed).
+1 to the CI reviewer's open RISK on _release_failed_seed: a close or re-seed from a different episode can stop and fence another episode's retained failed seed. Could you add the identity check before both releases?
bba82a9 to
9c699e6
Compare
ec990ad to
caa0d8b
Compare
9c699e6 to
5c278b2
Compare
3d60596 to
44b3b7e
Compare
gdpval's seed dropped its record of the sandbox when the stop of a failed seed raised, so the sandbox ran until its ttl_s. The seed now starts the sandbox and uploads the task's files as two steps, so the session holds the sandbox before the upload. A sandbox whose stop failed stays tracked until the session's close, a later seed of the session or the shutdown stops it. Only the failed seed's own episode may close it, and only its own episode and task may seed over it; another gets 409 and stops nothing, like a live session. The release also removes the task's reference files shielded, so a close that a disconnect cuts short still drops the session's record and fences it, instead of leaving a record without a sandbox. Signed-off-by: Ananth Subramaniam <[email protected]>
44b3b7e to
33aba16
Compare
hemildesai
left a comment
There was a problem hiding this comment.
Approving at 33aba16. The failed-seed ownership check is in (a close or re-seed from another episode or task gets 409 and leaves the seed alone), with tests covering both paths. After the rebase onto main the PR's own changes are unchanged, and CI is green.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44575825702 |
What does this PR do?
gdpval dropped its record of a sandbox when the stop after a failed seed raised, so the sandbox ran until its
ttl_s.rmtreecannot be cancelled anyway, so the removal has no time limit of its own.swebench_pro and terminal_bench_2_1, which this PR used to change too, pass their stop limits to
stop()in #6410. The other servers that stop a one-off sandbox already get the shielded, bounded stop from #6410 without a change. They still log a failed or timed-out stop and drop the sandbox, which itsttl_sreclaims, until they move onto the shared owner component.How it works
gdpval's seed, when the upload of the task's files or the reply fails and the stop of the new sandbox fails too:
flowchart LR subgraph before["Before"] direction TB a1["seed"] --> a2["start the sandbox and upload the files<br/>in one call"] a2 -->|"upload fails"| a3["stop fails"] a3 --> a4["nothing holds the sandbox,<br/>it runs until its ttl_s"] end subgraph after["After"] direction TB b1["seed"] --> b2["start the sandbox"] b2 --> b3["the session holds it"] b3 --> b4["upload the files, reply"] b4 -->|"fails"| b5["release"] b5 -->|"stop fails"| b6["kept as a failed seed"] b6 --> b7["the close, a later seed of the session<br/>or the shutdown stops it"] 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.
main, and each later fix is based on the branch of the one before it.mainwhen it resumes.The highlighted box is this PR.
ananthsub/sandbox-stop-untracked-owners): fix(gdpval): keep a failed seed's sandbox until a stop succeeds (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 shieldedananthsub/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: the normal stop path is the same call; what changes is cancellation and failed stops, which the unit tests cover.
Compatibility and benchmark impact
None.
Checklist
git commit -s).