You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
claim-test: concurrent mkdir CAS race fails intermittently on ubuntu CI #480
tests/fixtures/quest-log/claim-test.sh has a simultaneous-claims test (rounds 1–10) that launches two background claim-acquire processes and expects exactly one to exit 0 and the other to exit 6. The stub gh uses mkdir as its CAS primitive.
On ubuntu CI runners (azure eastus2, runner 20261021.618), both processes occasionally return exit 0 — the mkdir race fires — causing:
claim-test: round 1: exits 0:0, expected one 0 and one 6
Evidence
Two consecutive failures on PR #479 (only documentation and version-bump changes):
Run 40908299894, attempt 1: round 1 fails (exits 0:0)
Last successful main run on same runner version: Oct 28 (run 40612584652), claim-test passed.
The test passes consistently on macOS CI and locally.
Root cause hypothesis
The stub gh does two separate steps to atomically claim: mkdir -p "$GH_STORE/quest-claim" (parent) then mkdir "$GH_STORE/$name" (leaf, atomic CAS). Under high concurrency or IO pressure, both background processes may complete their mkdir -p (parent, idempotent) before either completes the leaf mkdir, and the kernel mkdir(2) atomicity guarantee occasionally fails on this runner configuration. Alternatively, the two-step sequence creates a window where a third party could interfere.
Proposed fix
Use a single atomic mkdir -p + unique name or a (set -C; >file) pattern for the CAS instead of two separate mkdir calls. Or pre-create the parent directory in new_store() so both background processes skip the mkdir -p step and go directly to the atomic leaf mkdir.
Outcome:tests/fixtures/quest-log/claim-test.sh passes deterministically on ubuntu-latest (Ubuntu 26.04) as well as macOS, with its stub gh label create acting as a true atomic test-and-create.
Provenance: issue claim-test: concurrent mkdir CAS race fails intermittently on ubuntu CI #480 body; CI run 40908299894 log (image ubuntu-26.04, failing) vs run 40612584652 (image ubuntu-24.04, passing); container reproduction: mkdir (uutils coreutils) 0.8.0 — two racing mkdir of one leaf both exit 0 in 1991/2000 trials, mkdir (GNU coreutils) 9.4 0/2000. The issue's kernel-mkdir(2) hypothesis is refuted; the parent-precreate remedy would not fix it. Exclusions approved by the operator interactively this session.
Exclusions: (1) pinning the CI ubuntu leg to 24.04 — owner: maintainer; (2) changes to production tracker.sh / profiles/github.sh claim code — owner: maintainer (no evidence of a defect there; it calls the GitHub API, not mkdir).
Activity
randomparity commentedon Oct 29, 2026
Scope — issue #480
q480-4ec325bbtests/fixtures/quest-log/claim-test.shpasses deterministically on ubuntu-latest (Ubuntu 26.04) as well as macOS, with its stubghlabel create acting as a true atomic test-and-create.mkdiratomicity (source: issue claim-test: concurrent mkdir CAS race fails intermittently on ubuntu CI #480 problem statement + proposed fix; root cause confirmed by reproduction below)..claude-plugin/plugin.jsonPATCH bump (source: repo rule, ADR 0022).documentationlabel replaced withtype:bug(source: operator decision, this session).ubuntu-26.04, failing) vs run 40612584652 (imageubuntu-24.04, passing); container reproduction:mkdir (uutils coreutils) 0.8.0— two racingmkdirof one leaf both exit 0 in 1991/2000 trials,mkdir (GNU coreutils) 9.40/2000. The issue's kernel-mkdir(2)hypothesis is refuted; the parent-precreate remedy would not fix it. Exclusions approved by the operator interactively this session.tracker.sh/profiles/github.shclaim code — owner: maintainer (no evidence of a defect there; it calls the GitHub API, notmkdir).tests/fixtures/quest-log/claim-test.sh(stubghcreate path and its comments);.claude-plugin/plugin.jsonversion; issue claim-test: concurrent mkdir CAS race fails intermittently on ubuntu CI #480 labels.Tracking: blast radius — one test fixture; change hazards — none (shipped code unchanged; the fix restores the stub's intended atomicity); complexity — S; decompose — one PR; classification — trivial-bugfix; artifact lane — no-spec; review depth — single-pass; design denominator — not-applicable (no-spec).
randomparity commentedon Oct 29, 2026
Trajectory — issue #480
feat/claim-cas-480, PR fix(test): make claim-test stub CAS independent of mkdir #481.just cigreen via pre-push hook at915ae4b; CI green on ubuntu-latest (image ubuntu-26.04) and macos-latest.mkdir0.8.0 is non-atomic under a race; the stub CAS is now a bash noclobber (O_EXCL) create.