Repository navigation
nvx: wait for a launch log's claim release with the shared claim wait - #2264
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoNov 27, 2026
Merged
Conversation
LockedState::released_claim, which rechecks whether a process still holds an interrupted launch's log claim, bounded the recheck with a literal one second. The scratch module already names that wait, CLAIM_RELEASE_WAIT, with its reason: a process that another thread of the caller spawns holds an inherited copy of a claim from its fork until it executes its program. The launch log's claim is inherited the same way: its flock on Linux, and on Windows its open handles when the log has no job, though not the job-based claim. released_claim now waits CLAIM_RELEASE_WAIT, whose doc comment also names the log claim and when it is inherited, so one constant bounds both waits. The value stays one second and the expression keeps its form, so recovery waits exactly as long as before. Both modules build only with the cli feature. The store and scratch unit tests pass unchanged at 8d47379 and after the change on Windows: 45 passed, 2 ignored. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the shared claim-release wait change.
No open issues 🎉
What changed in this PR
Addresses #2263 by sharing the existing claim-release wait between interrupted launch-log recovery and scratch-image checks. The wait remains one second, preserving recovery behavior.
Changes:
- Replace the launch recovery timeout literal with
CLAIM_RELEASE_WAITand remove the unusedDurationimport. - Expand the constant’s documentation to cover launch-log claims on Linux and Windows.
| File | Description |
|---|---|
nvx/src/host/sandbox/scratch.rs |
Document the shared wait’s use for launch-log claims. |
nvx/src/host/cli/store/launch.rs |
Use the shared constant and update its documentation reference. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-2263-claim-release-wait
branch
November 27, 2026 18:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2263
What does this pull request change?
LockedState::released_claiminnvx/src/host/cli/store/launch.rsbounded its recheck of an interrupted launch's log claim with a literalDuration::from_secs(1). It now waitsCLAIM_RELEASE_WAIT, the constant thatnvx/src/host/sandbox/scratch.rsalready defines, with its rationale, for the same fork-to-exec window of a scratch image's claim, and that the CLI's launch already waits for that claim. The constant's doc comment now also names the launch log's claim, and when a spawned process holds it: through theflockon Linux, and on Windows while the claim is the log's open handles (not the job-based claim).launch.rsdrops its now unusedDurationimport.Start at
released_claiminlaunch.rs. The change leaves out the follow-ups in #2263: sharing one bounded retry helper betweenreleased_claimand the scratch module'suntil_unclaimed, and naming the century literal inDeadline::instant.Why is this change needed?
Two waits bounded the same window, the time that a process which another thread of the caller spawns holds an inherited copy of a claim before it executes its program, but only one stated why it lasts one second. With one named constant, the reason is stated once and the two waits cannot drift apart. The value stays one second and the expression keeps its form (
deadline.min(Instant::now() + WAIT)), so recovery waits exactly as long as before. Both modules build only with theclifeature, on every target, so the import adds no gating. I chose reusing the existing constant over adding a second constant with the same value and rationale.How was this change validated?
Checks and results:
cargo test --locked --all-features --lib -- host::cli::store host::sandbox::scratchinnvx/: 45 passed, 2 ignored at base8d47379b460and at the head; the tests are unchanged.python scripts\local_gates.py --base origin/dev --runon this Windows workstation, with the releasenvxbuilt andNVXset: test-changes, markdown-links, test-layout, nvx-format, nvx-lint, nvx-test, nvx-doc, nvx-msrv, and nvx-cli passed. The doc comment's final wording landed during that run, so--only nvx-format nvx-lint nvx-doc --runwas rerun atb9ee2fe55cband passed.python3 scripts/local_gates.py --base origin/dev --run --keep-goingatb9ee2fe55cbin a clone in this workstation's WSL 2 (Linux): test-changes, markdown-links, test-layout, nvx-format, nvx-lint, nvx-test, nvx-doc, nvx-public-api, nvx-msrv, nvx-macos, nvx-guest-binaries-lint, and nvx-guest-binaries-build passed. nvx-cli first stopped at itspip installstep because WSL's system Python is externally managed (PEP 668). It was then rerun in full with--only nvx-cli --runfrom a temporary--system-site-packagesvenv, where the pinned PyYAML 6.0.3 was already satisfied, and passed.guest::sys::signal::tests::a_thread_that_blocks_sigpipe_keeps_only_a_signal_that_was_pendingwhile the Windows gates loaded the same machine. That test passed 3 of 3 runs alone both at base8d47379b460and at the head, and the full nvx-test gate passed on the rerun above.python scripts/check_test_changes.py --base origin/dev: 0 changes to existing tests.Backend, host OS, host type, and guest: no configured host was reachable (kvm: azure-intel-kvm-1 to -5 and -7, azure-amd-kvm-1 to -4; whp: azure-intel-whp-1 to -7, -11, -12, azure-amd-whp-1 to -4), so the checks ran locally on Windows and in WSL 2, not on a configured host. No microVM ran: the change keeps the waited value and expression exactly.
Left to CI: the microVM scenarios on kvm, mshv, and whp, and the benchmarks.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.