mirror of https://github.com/garrytan/gstack.git
reclaimIfStale treated any live pid matching the recorded owner as proof the lock is still held. After a crash the OS can recycle that pid for an unrelated process, so a liveness check alone would refuse to reclaim a lock whose real owner is long gone, permanently disabling auto-persistence for the workspace. Cross-check the owner's recorded lock-acquire time against the live process start time via `ps -o lstart=`: if the live process started after the lock was taken, the pid was reused and the lock is stale. Fallback is conservative — if start-time can't be read (ps fails, timeout, non-Unix, unparseable), we keep the lock rather than risk stealing an active peer's slot. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bin | ||
| scripts | ||
| src | ||
| test | ||
| PLAN-snapshot-dropdown-interactive.md | ||
| SKILL.md | ||
| SKILL.md.tmpl | ||