Skip to content

v0.7.4 — trust a durable owner-pid; keep the lease authoritative

Choose a tag to compare

@shanemhamilton shanemhamilton released this 02 Jul 14:16
· 4 commits to main since this release
629bb2a

Fixes the lock-liveness model after a live-fleet incident. A job lock's recorded pid was run_lock.py's own transient CLI-subprocess pid, dead within milliseconds of acquire — so it read "dead" for every lock and was never a real liveness signal. That made "pid dead ⇒ owner crashed" a false positive, and reclaiming on it could take over a lock a still-running agent holds.

Fixed

  • run_lock.is_abandoned treats a trusted, same-host owner pid (via --owner-pid) as ground truth both ways — alive ⇒ never abandoned even past its lease; dead ⇒ abandoned immediately — and otherwise makes the lease authoritative. A dead untrusted pid on an unexpired lease is no longer abandoned, so reclaim/reap/acquire can never take over a live run's lock. Also fixes a pid-reuse false positive that could keep an expired-lease lock blocked indefinitely.

Added

  • acquire/reclaim accept --owner-pid <pid>; the owner records pid_trusted: true and a crashed run becomes reclaimable before its lease expires. token still derives from run_lock's own pid (unique per acquisition). Omit → lease governs (backward-compatible). Not wired into the managed block by default: a per-command $$ is not durable and would re-arm the bug; activation needs a long-lived owner pid.

Verification

All four suites green on Python 3.11 and 3.12: lifecycle 80, optimizer 48, state 184, digest 44 — 0 failed.