install: fix EEXIST race losing files in parallel install -D#12429
install: fix EEXIST race losing files in parallel install -D#12429eyupcanakman wants to merge 1 commit into
Conversation
|
GNU testsuite comparison: |
| )), | ||
| }; | ||
| } | ||
| Err(e) if e.kind() == io::ErrorKind::NotFound => match parent_fd.mkdir_at(name, mode) { |
There was a problem hiding this comment.
done, added comments on the create and retry arms
9fef9fd to
a01f2f4
Compare
Concurrent install -D invocations sharing parent directories race in open_or_create_subdir between stat_at returning NotFound and mkdir_at. Another process can create the directory in that gap, so our mkdir_at returns EEXIST. Retry the stat to open the directory the other process created. Fixes uutils#12355.
a01f2f4 to
d1416c3
Compare
Merging this PR will degrade performance by 3.31%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | du_summarize_balanced_tree[(5, 4, 10)] |
6.6 ms | 6.9 ms | -3.31% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing eyupcanakman:fix/install-d-eexist-race-12355 (d1416c3) with main (80cc829)2
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(47d7c76) during the generation of this report, so 80cc829 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Fixes #12355.
Concurrent
install -Dinvocations sharing parent directories race inopen_or_create_subdir. Betweenstat_atreturning NotFound andmkdir_at, another process can create the directory, so ourmkdir_atreturns EEXIST. Retry the stat to open the directory the other process created.#11505 also edits this function for a different concern (symlink-following per #11469); the two changes touch separate branches and rebase cleanly either way.