Skip to content

install: fix EEXIST race losing files in parallel install -D#12429

Open
eyupcanakman wants to merge 1 commit into
uutils:mainfrom
eyupcanakman:fix/install-d-eexist-race-12355
Open

install: fix EEXIST race losing files in parallel install -D#12429
eyupcanakman wants to merge 1 commit into
uutils:mainfrom
eyupcanakman:fix/install-d-eexist-race-12355

Conversation

@eyupcanakman

@eyupcanakman eyupcanakman commented May 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #12355.

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, so our mkdir_at returns 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.

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/seq/seq-epipe is now passing!

)),
};
}
Err(e) if e.kind() == io::ErrorKind::NotFound => match parent_fd.mkdir_at(name, mode) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, added comments on the create and retry arms

@eyupcanakman eyupcanakman force-pushed the fix/install-d-eexist-race-12355 branch from 9fef9fd to a01f2f4 Compare June 7, 2026 18:36
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.
@sylvestre sylvestre force-pushed the fix/install-d-eexist-race-12355 branch from a01f2f4 to d1416c3 Compare June 7, 2026 20:56
@codspeed-hq

codspeed-hq Bot commented Jun 7, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 3.31%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 322 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. 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.

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install -D loses some files to EEXIST

2 participants