Skip to content

Tolerate concurrent creation of directories#506

Merged
Sharpie merged 1 commit into
OpenVoxProject:mainfrom
Sharpie:ensure-dir-idempotent
Jul 1, 2026
Merged

Tolerate concurrent creation of directories#506
Sharpie merged 1 commit into
OpenVoxProject:mainfrom
Sharpie:ensure-dir-idempotent

Conversation

@Sharpie

@Sharpie Sharpie commented Jul 1, 2026

Copy link
Copy Markdown
Member

Short description

When two processes both decide a directory needs to be created (e.g. multiple JRuby instances in openvox-server independently bootstrapping Puppet settings against the same confdir), Dir.mkdir raises Errno::EEXIST for whichever one loses the race, surfacing as a resource failure even though the desired state was actually achieved. Treat EEXIST as success when the path is now a directory, while still raising for a genuine conflict (e.g. a file or symlink already at that path).

Checklist

I have:

When two processes both decide a directory needs to be created (e.g.
multiple JRuby instances in openvox-server independently bootstrapping
Puppet settings against the same confdir), Dir.mkdir raises Errno::EEXIST
for whichever one loses the race, surfacing as a resource failure even
though the desired state was actually achieved. Treat EEXIST as success
when the path is now a directory, while still raising for a genuine
conflict (e.g. a file or symlink already at that path).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Charlie Sharpsteen <charlie@overlookinfratech.com>
@Sharpie Sharpie added the bug Something isn't working label Jul 1, 2026
@Sharpie

Sharpie commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

This is one half of a fix for random test failures that have been plaguing OpenVox Server. See OpenVoxProject/openvox-server#414

@Sharpie Sharpie enabled auto-merge July 1, 2026 15:51
@Sharpie Sharpie merged commit c95d95f into OpenVoxProject:main Jul 1, 2026
32 of 34 checks passed
@Sharpie Sharpie deleted the ensure-dir-idempotent branch July 1, 2026 17:02
@Sharpie Sharpie added the backport 8.x backports the merged PR to the 8.x branch label Jul 1, 2026
@OpenVoxProjectBot

Copy link
Copy Markdown
Contributor

Successfully created backport PR for 8.x:

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

Labels

backport 8.x backports the merged PR to the 8.x branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants