Repository navigation
Fix concurrent initialization directory creation - #267
Merged
Merged
Conversation
VolkerChristian
added a commit
that referenced
this pull request
Oct 12, 2026
Fix concurrent initialization directory creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Architectural invariant
Concurrent processes sharing the configuration, state and runtime directories must initialize successfully when another process creates a directory first. Only real filesystem errors are failures; ownership and permissions are changed only by the creator.
Fix
Remove the racy
existsprechecks and the false-result error branches fromConfig::init.std::filesystem::create_directoriesis now the sole authority: true means newly created, false means an existing directory, and actual filesystem errors still propagate. This also rejects an existing non-directory instead of silently accepting it.No retries, test serialization, precreated directories, workflow workarounds, new production helpers or public API/ABI changes.
Regression and verification
mkdirresult deterministically, without production hooks. Verifies existing and competing-creator permissions are preserved.git diff --checkpassed.This resolves the startup race observed in default-branch Verify run https://github.com/SNodeC/snode.c/actions/runs/38068740872 before the development SDK could be published. Package workflows, licence files, READMEs, VERSION and stable release tags are unchanged. CodexUI/AutoTalk test fixes remain explicitly deferred.