Repository navigation
Conversation
…bounded retry 5051505 fixed one test. Four other test sites still took the journal directory lock with one try_lock(). A child forked on another test thread can briefly hold a copy of an earlier lock fd (#381), so they failed with "WouldBlock" in CI (live_transaction_creator_preserves_partial_files_and_bindings, journal.rs:4336, run 39018319086). They now use lock_journal_directory, the provider's own bounded retry. Test code only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6Qn9RX7LDqrwiAfNC2F2K
Contributor
Author
|
Review: A. The bounded retry matches the WouldBlock failure in run 39018319086. Ready for Anders once CI is green. |
Contributor
Author
|
Round 3 review: PASS (A). Body, code and tests agree. |
This was referenced Oct 19, 2026
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 #381.
What this changes
Four test sites in
capsules/model-provider/src/journal.rstook the journal directory lock with a singletry_lock().unwrap(): lines 3944, 3950, 4263 and 4336 on develop. They now take it withlock_journal_directory, the provider's own bounded retry (journal.rs:2167). Only test code changes. The provider'stry_lockat:2172, inside that retry, is unchanged.Why
5051505 (#381) found the cause. A child process that another test thread forks can hold a copy of an earlier lock fd for a short time, so a single
try_lock()can returnWouldBlock. That commit fixed one test:held_transaction_directory_lock_blocks_recovery_and_atomic_writesatjournal.rs:4223, which is the failure Anders cites when he reopened #381 (alpha.22 develop push, run 38919906568, job 117040001433). The same pattern then failed in CI in another test:(job 117356008539, run 39018319086,
test-capsuleson #417's merge with develop.)This PR fixes every remaining site at once, so the flake does not move to the next test. With 5051505 (already on develop) and this PR, every test in
journal.rsthat takes the directory lock itself uses the bounded retry. That is the first fix #381 proposes ("the test retries try_lock for a bounded time"). The other option it names, close-on-exec test fds before any fork, is not done here.Proof
On this branch,
cargo test --lib journal::ran three times in a row:cargo fmt -- --checkandcargo clippy --all-targetswith-D warningsare clean.Gap: the flake depends on timing. Passing runs here do not prove the race is gone. It goes away because every test site now waits the same bounded time that the provider itself waits.
Merged into
This fix is merged into any open draft PR whose
test-capsulesjob fails on this test. The first is #417.Generated by Claude Code