Repository navigation
Commit 6f812a0
authored
fix: prevent duplicate run IDs on false-success mkdir (#81)
Concurrent agent launches can allocate the same run ID when mkdir
reports success after losing the race to create run.lock. Require both a
successful exit and a nonempty creation receipt before entering the
allocator, matching the existing metadata lock protection. The retry
limit and cleanup protocol remain unchanged.
The regression holds another writer's lock and models false-success
mkdir. It verifies that allocation never enters the critical section,
removes the held lock, or changes existing events. It fails on the
original implementation and passes with the guard.
This is the production allocator fix targeting current main. Its diff
contains only lib/cmd/agents.sh and test/run_lock.bats. No benchmark
workflow, readiness changes, worker-default changes or benchmark
documentation are included. Benchmark PR #73 remains a separate,
unmerged reference.
Validation:
- Local regression and full lint pass after updating from current
origin/main.
- [Fresh Linux/macOS
CI](https://github.com/TSLsun/tmux-collie/actions/runs/41453065875) is
green on current-main-updated head `0af5348`.
- [Controlled
experiment](https://github.com/TSLsun/tmux-collie/actions/runs/41376826676)
tested the identical allocator/test patch: all 120 real concurrent-ID
checks passed. Its separate Codex/Gemini readiness failures remain
recorded; neither was a duplicate-ID failure.
- The native Linux probe observed 17 status-0/no-creation-receipt mkdir
exits in 50 rounds of 32 contenders; kernel controls had one winner per
round. [Upstream
mechanism](uutils/coreutils#13970).
User authorization promotes this PR from an experimental candidate to a
production fix for review. Merging remains a separate human decision; no
automatic merge is enabled.1 parent b8574d6 commit 6f812a0
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments