Files
gbrain/test
Garry TanandClaude Fable 5 ee14640ae9 fix(page-lock): never fast-steal a fresh lock on a dead-looking PID (#2840)
process.kill(pid, 0) returns ESRCH for LIVE holders in another PID
namespace (containerized serve + jobs-work sharing GBRAIN_HOME), so the
PID-liveness fast-steal silently stole live locks and re-opened the
concurrent read-modify-write race the lock exists to prevent.

Staleness is now mtime-TTL only (holders already refresh(); crashed
holders age out in 5 min), matching the #2348 pglite-lock philosophy:
never steal a possibly-live holder. Ownership for refresh()/release()
moves from PID comparison (same cross-namespace false-self problem) to a
per-acquire random token, so a stale handle can never clobber or unlink
a new owner's lock.

Fixes #2840

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:57:44 -07:00
..