Repository navigation
Conversation
…sed (fixes #890) Losing a publication race failed with the rename's error on Windows when the winner's entry was held open without delete sharing. The entry is content-addressed, so the winner's output is ours: return it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DenRakEiw
left a comment
There was a problem hiding this comment.
Tested head 5229ab8 (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):
cargo test -p victory-pipeline: 5 passed, 0 failed (includingcache::tests::an_entry_published_meanwhile_is_used)cargo clippy -p victory-pipeline --all-targets: 0 warningscargo xtask policy: ok
Clean Windows concurrent-publication fix for Cache::get_or_convert (fixes #890). Approving.
AI-assisted (Gemini 4 Neon).
…sed (fixes Marvisak#890) Upstream: Marvisak#1070 by @acleofe
catminou4
left a comment
There was a problem hiding this comment.
Losing a publication race to an identical entry is now a hit instead of an error — the reasoning holds because the cache key covers converter id + version + input, so a concurrently published entry for the same key is byte-identical output. The staging temp file is still removed on failure, and path.is_file() only accepts an already-complete entry (the writer publishes by rename, so a partial file can't be observed). The #[cfg(windows)] racer test reproduces the exact Windows condition (reader holding the entry without delete sharing) and also asserts no staging file leaks.
Verified locally: test-merge with main clean; cargo test -p victory-pipeline --locked (macOS arm64, rustc 1.98.1) → 4 passed / 0 failed. Scope note: the new race test itself is Windows-only (it needs share_mode), so macOS covers compilation and the existing cache tests; the fix is platform-independent logic. Approving.
|
Independent Linux/Wine validation of Full workspace unit/integration suite, all features, all 14 generated Windows MSVC test executables: 342 passed, 5 failed, 6 ignored. Matched baseline: 341 passed, 5 failed, 6 ignored. The five failures are unchanged: empty pipeline library (#347), missing Wine Winsock export (#217), checksum-rejection expectation, nested Cargo fixture build, and Windows xtask attempting to launch host Git. Both Windows-target workspace Clippy configurations (all targets, with and without all features, Negative control: I retained the new regression but restored the old Rust 1.98.1, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton |
What
When
Cache::get_or_convertcannot rename its staged output into place but the entry exists by then, it returns the entry instead of the rename error. The staging file is still removed, and a failure with no entry there is still an error.Why
Two converters of the same key can race: the loser's
renamereplaces the winner's file, which on Windows fails with access denied while anything holds that file open without delete sharing (antivirus, another process, a mapping). The entry is content-addressed by converter id, version and input, so the winner's output is the loser's; the conversion succeeded and the result is there.Test
an_entry_published_meanwhile_is_used(Windows): a converter publishes its own key's entry while converting and holds it open with read sharing only. Before this changeget_or_convertfailed withAccess is denied. (os error 5); now it returns the entry, its content is right and no staging file is left.failed_publication_removes_the_staging_filestill fails as before (a directory at the entry's path is not an entry).cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsandcargo test --workspace --lockedpass.🤖 Generated with Claude Code