Repository navigation
fix(agc): remove the temporary benchmark file when its write fails - #12234
oneandonlydean merged 2 commits into
Conversation
ReplaceGzip writes the gzip to <name>.tmp and renames it over the benchmark file. The write sat outside any handler, so a write that failed half way, such as a full disk, threw out of ReplaceGzip and left the partial temporary file; only a failed rename removed it. The write is now guarded: the temporary file is removed (unless something else made it a directory) and the exception is rethrown.
<name>.tmp is a symlink to /dev/full, which accepts the open and fails the write with ENOSPC; ReplaceGzip has to throw and leave no temporary file. The case runs on Linux when /dev/full exists.
|
Windows + NVIDIA result for head This PR's own tests: Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver 621.01), Khronos Validation Layers nightly 1.4.366 (b2b44c0d37) through Same focused run on
The tree also carried the open PRs #12298, #12272, #12262, #12256, #12250, #12228, #12211, #12210, #12209, #12208, #12207, all merged cleanly, so the run is a joint one. Not run on a PS5. AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
What
TraceFile::ReplaceGzipwrites the gzip to<name>.tmpand renames it over the benchmark file. The write sat outside any handler, so a write that failed half way (a full disk, for example) threw out ofReplaceGzipand left the partial temporary file behind; only a failed rename removed it.FlushIntervalcalls it every interval, so the stale file stays until a later write truncates it.The write is now guarded: the temporary file is removed (unless something else made that name a directory) and the exception is rethrown.
Two commits: the fix, then the test (
ReplaceGzipFileinPerformanceTrace.cpp: on Linux,<name>.tmpis a symlink to/dev/full, which accepts the open and fails the write with ENOSPC;ReplaceGziphas to throw and leave no temporary file).Tested
Linux x86-64, a throwaway archive build with the host CPU gate patched.
agc_performance_tracepasses. With the guard removed the same test fails with "a replace whose write failed left its temporary file behind". The case is skipped when/dev/fulldoes not exist and does not run on Windows.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)