mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-26 02:00:52 +01:00
Stale-gate recovery reaped an identity-less gate after a fixed one-second grace period. A live holder that created its gate, then took longer than that period to write its pid and token, could lose the gate to recovery mid-critical-section, letting a second admission or teardown overlap the first holder. Write a holder's pid and token to a private staging path first, then publish that content to the shared path with one atomic link. The shared path now never names a gate before its content is complete, no matter how long the write itself takes, so the grace-period fallback only ever fires against genuine damage, never a slow live holder. Co-authored-by: Paperclip <noreply@paperclip.ing>