rehearsal-cycle.sh keeps the #663 capacity reservation up for the whole drive — release it on acquire so one-slot work can use the free slot (ADR 0003 slot host) #1652
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1652
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
On
elitebook-03(aDRIVE_EXCLUSIVE=slothost) a rehearsal drive keeps/tmp/matou-drive-wanted(the #663 capacity reservation) standing for its whole run, not just while it is waiting for a slot. While the file is fresh every heavy consumer on the host — swarm/triage/healer/session-runner for every repo — yields its tick (reason=yielded-to-drive, exit 0) even though the drive holds only slot 1 and slot 2 is free.Observed 2026-09-19 ~04:20Z: drive
20260919T035808Zon #1277 (targetlocal-guest) in flight since 03:58Z holding/tmp/matou-swarm.lockonly (/proc/locksconfirms slot 2 unheld); healer defer-count 3, dev-factory/idss/matou-website session-runner defer-counts 2 each;session-runner-*.logshow hundreds ofdeferring to a ready drivelines. The #1277 standing drive is re-firing every ~1.5 h (RED → blocker → swarm fix → refire: 19:32, 21:14, 00:44, 03:58), so the host is under a drive ~60% of the time — which is intended and stays — but each run should not fence off the free slot.The drive alone would let the reservation age out after
HOST_CAPACITY_DRIVE_WANTED_TTL(900 s), so on its own it over-fences for 15 min per drive. Combined with aMatou/matou-apppr-e2ejob camping on the same host and re-touching the same file every 20 s (matou-app ticket linked below) the fence stays up for the entire drive.Cause
scripts/rehearsal-cycle.sh:host_capacity_drive_reserve(line ~74) runs before theDRIVE_EXCLUSIVEacquire branch, andhost_capacity_drive_releaseis only ever called from the EXIT traps (lines ~170, ~287). The reservation exists to stop NEW heavy work grabbing the slot a waiting drive needs (#663/#664). Once the acquire has succeeded the drive holds a real flock, and the lib's own comment says the reservation "costs nothing" lapsing mid-drive — but nothing lets it lapse, and other reservers keep it fresh.Ruling (Ben, 2026-09-19)
So: the drive keeps its instant refire (executor self-nudge untouched) and keeps reserving while it is genuinely waiting; it must release the reservation the moment it has won capacity (both
slotandallbranches — underallthere are no free slots anyway, so releasing is harmless). This is exactly what.sandcastle/host-slot-wait.sh --exclusivealready does: reserve while polling, release right after acquiring, then run holding the flocks.Change
scripts/rehearsal-cycle.sh: immediately after thecapacity_busycheck passes (just before/athost_capacity_drive_skip_reset), callhost_capacity_drive_release. Keep the existing EXIT-trap releases (idempotent, belt-and-braces for the wait-then-crash path).scripts/tests/rehearsal-drive-exclusive-test.sh(offline): in both theslotand unset/allcases assert/tmp/matou-drive-wanted(re-pointed viaHOST_CAPACITY_DRIVE_WANTED) is absent once the acquire has succeeded and the drive body is running, and still present on the busy/yield path.Acceptance
Offline: the test above green. Live: on elitebook-03, with a drive in flight,
stat /tmp/matou-drive-wantedis absent (or older than 900 s) and a session-runner/swarm tick takes slot 2 instead of loggingdeferring to a ready drive— provided the matou-app camping job is also fixed (linked below); until then matou-app's 20 s re-touch will still keep the file fresh.Related
DRIVE_EXCLUSIVEbranch), #663/#664 (the reservation), #657 (the starvation it solved — the other direction).pr-e2etwo-slot camp onelitebook-03(link in first comment).sloton elitebook-03 says a drive is "Playwright + SSH to a droplet, no local build"; alocal-guestdrive boots a KVM guest locally.freeshowed ~12 GB available mid-drive on 2026-09-19 soslotstill looks safe, but the reasoning in the ADR is stale and worth a one-line amendment.Sibling (matou-app side, the 20 s re-touch that keeps this reservation fresh): Matou/matou-app#572
swarm-claim host=bens-mac-04 run=28113
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1652 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope