vamos: create shared volume dirs with exist_ok - #4
Merged
Conversation
Concurrent vamos instances share ~/.vamos/volumes and, on the first run of a fresh setup, race to create the auto 'system:' volume, its base dir, and the auto-assign subdirs (c:, s:, libs:, ...). All but one instance hit FileExistsError and abort with "invalid volume spec: 'system:?create'" or "can't create relative dir". Pass exist_ok=True to the three os.makedirs that build these shared dirs, matching the mkdtemp hardening already done for temp volumes.
Author
|
Validated in the toolchain CI (release-gate config: Linux build + gcc testsuite under vamos, The three spurious |
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.
When many vamos instances run in parallel against a shared HOME (the gcc testsuite launches dozens at once), the first burst races to create
~/.vamos/volumes, the autosystem:volume, and its auto-assign subdirs.os.makedirs()withoutexist_okraisesFileExistsErrorfor all but the winner, so those instances abort with:or
can't create relative dir: c. In the AmigaPorts m68k-amigaos-gcc CI this shows up as a handful of spurious-O0execution FAILs per run, on whichever tests happen to be in the first concurrent batch. The programs never touch the filesystem; thesystem:volume is just vamos's default env (asys:assign for the CWD), so sharing it read-only is fine, only its creation races.This mirrors PR #3, which fixed the same class of race for temp (
ram:) volumes via mkdtemp. Here the threeos.makedirsthat build the sharedsystem:dirs getexist_ok=True.Tested: 960 concurrent launches sharing one fresh HOME, 0 failures (was ~1-2% before).
pytest test/unit -k "path or volume"-> 70 passed.