Pipeline library: cut writes leave unique staging files that are never removed (follow-up to #1660) #2494
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Makto94 on 2026-11-25T14:50:09Z.
Since #1660,
write_atomically()stages each write in<file>.tmp-<pid>-<n>. Before, the fixedhost-pipelines.tmpwas overwritten by the next save.A write can still be cut:
save(true)returns early whenadded == 0 && !USED_CHANGEDwithout waiting for a worker's save that is writing.end()then callsTerminateProcess, and nothing stops thevictory-pipelines-Nworkers.WRITINGis per file, so even a waitingsave(true)can let the worker's second write (early-pipelines.txt) start and be cut.host_gpu_failedand crash exits callTerminateProcessdirectly.Each cut write now leaves a staging file that no later run reuses, and nothing sweeps the cache folder. The target file stays whole.
A port of #1660 elsewhere fixed this in two small commits: one lock held across the whole of
save(), taken before the early return; and a sweep of stalehost-pipelines.bin.tmp-<digits>-<digits>/early-pipelines.txt.tmp-<digits>-<digits>regular files inuse_pipeline_cache(), immediately for the own pid and after 10 minutes for other pids, because the cache folder is shared and there is no single-instance guard. Reference: https://github.com/LaunchDoesntCode/VI-Port/pull/174Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T15:03:41Z.
Claimed the stale staging-file sweep half on #1633 (
use_pipeline_cache()sweepinghost-pipelines.bin.tmp-<digits>-<digits>andearly-pipelines.txt.tmp-<digits>-<digits>regular files, own pid immediately and other pids after 10 minutes), leaving thesave()lock half to open PR #2328 to avoid overlap.AI-assisted (Claude Code / Claude Sonnet 5.5).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:50:56Z.
Automated triage for the maintainers.
Confirmed in main, in
crates/victory-gpu/src/pipeline/library.rs.write_atomicallystages each write in<file>.tmp-<pid>-<n>and removes it only when the write or rename returns an error.use_pipeline_cacheonly records the folder and sweeps nothing. So any write cut byTerminateProcessleaves a staging file that stays there for good.save()returns early when nothing was added, without waiting for a save already running. One correction:WRITINGis a single static lock shared by all files, not one per file. It is held for eachwrite_atomicallycall, not across the wholesave(), so the effect described here still holds.Open PR #2328 makes saves run one at a time. The sweep of stale staging files has been claimed on #1633. No PR for it is linked in this thread yet.
Generated by Claude Code