Skip to content

vamos: create shared volume dirs with exist_ok - #4

Merged
reinauer merged 1 commit into
AmigaPorts:mainfrom
codewiz:fix-vamos-volume-race
Aug 27, 2026
Merged

vamos: create shared volume dirs with exist_ok#4
reinauer merged 1 commit into
AmigaPorts:mainfrom
codewiz:fix-vamos-volume-race

Conversation

@codewiz

@codewiz codewiz commented Aug 27, 2026

Copy link
Copy Markdown

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 auto system: volume, and its auto-assign subdirs. os.makedirs() without exist_ok raises FileExistsError for all but the winner, so those instances abort with:

path: ERROR: error creating volume base dir: .../.vamos/volumes -> [Errno 17] File exists
path: ERROR: invalid volume spec: 'system:?create'

or can't create relative dir: c. In the AmigaPorts m68k-amigaos-gcc CI this shows up as a handful of spurious -O0 execution FAILs per run, on whichever tests happen to be in the first concurrent batch. The programs never touch the filesystem; the system: volume is just vamos's default env (a sys: 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 three os.makedirs that build the shared system: dirs get exist_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.

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.
@codewiz

codewiz commented Aug 27, 2026

Copy link
Copy Markdown
Author

Validated in the toolchain CI (release-gate config: Linux build + gcc testsuite under vamos, run_testsuite=true, pointed at this branch via amitools_git): https://github.com/AmigaPorts/m68k-amigaos-gcc/actions/runs/33063607276

The three spurious -O0 execution FAILs from the volume race are gone: expected passes 24408 -> 24411 (exactly the three flaky tests), unexpected failures 18 -> 15. The remaining 15 are pre-existing real issues unrelated to vamos (conversion.c __floatundixf, pr78622 %hhd, pr39228).

@reinauer
reinauer merged commit 76fd7b9 into AmigaPorts:main Aug 27, 2026
10 checks passed
@codewiz
codewiz deleted the fix-vamos-volume-race branch August 27, 2026 19:14
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.

2 participants