mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 17:45:53 +01:00
A recovery lock holder's own release used a plain, unconditional unlink. A stale-lock break can judge a still-live holder's lock stale and remove it while that holder is still mid-recovery; a later admission can then win a fresh lock at the same path before the first holder finishes. The first holder's own release then deleted that live replacement, letting a third admission win its own lock and run recovery concurrently with the second. Fix release to pin its own lock instance under a private path for as long as it holds the lock, then release by that pinned identity: a match proves it caught its own lock, safe to delete; a mismatch means a replacement was caught by mistake, so this restores it instead. Co-authored-by: Paperclip <noreply@paperclip.ing>