Files
PaperClipAI/packages
Priya RamanandPaperclip 5e1feb5e6f fix(runner): close the ACPX sandbox ownership check race
A claim (marker write plus lease registration) and a teardown (marker
read, lease count, then root delete or marker release) each read state
and then act on it, as two separate filesystem calls. A concurrent
claim could land in the gap between a teardown's read and its act: the
teardown read zero other leases, a new admission then registered a
lease and started using the root, and the teardown deleted or released
that root anyway.

Add a per-root gate file, opened with O_CREAT|O_EXCL like the marker
claim, so a claim and a teardown for the same root run one at a time
across every Runner process. A stale gate left by a crashed process is
broken only when its holder process is provably gone.

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