Files
PaperClipAI/packages
Priya RamanandPaperclip eddb215f73 fix(runner): break an ACPX recovery lock by its holder pid, not its age
A slow disk can keep a live recovery pass running past the recovery
lock's stale-age bound. The old check judged staleness by age alone, so
it could reap a still-live lock and let a second admission recover the
same gate at the same time, risking unsafe teardown of a live sandbox
root.

The lock now stages its holder pid before it ever names the shared
path, the same way the gate itself stages its content, and a break
attempt checks that pid for life before it removes the lock — matching
the check the gate already uses for its own holder. Age is now only a
fallback for a lock whose content cannot be read.

Also close a related race in the same break function: it kept its own
pin file linked until the whole function returned, so a poll could
observe the lock already restored while the pin's private name was
still present. The pin is now released right after the identity check
it protects, closing that window.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-03 17:50:48 +00:00
..