Skip to content

publish-dashboard.sh's own lock-liveness read is not host-aware

Id: TD-PPagop-26080101 · Status: resolved · Filed: 2026-08-01 · Resolved: 2026-08-02 · Ref: #161

scripts/publish-dashboard.sh‘s lock_alive check ([[ "$lock_pid" =~ ^[0-9]+$ ]] && kill -0 "$lock_pid" 2>/dev/null) judges lock.json/review-lock.json liveness with a bare kill -0 in its own PID namespace, without looking at the lock’s host field first — the same namespace confusion #130 fixed in the watchtower pre-update hook and TD-PPagop-26072901 fixed in both cycle scripts’ acquire_lock. On a containerised node the Publisher can share a state volume with a writer running in a different container than the one that wrote a leftover lock; a kill -0 that happens to collide with a local process would then report status.current as a live cycle when none is running on that lock’s actual writer, or the reverse. Lower severity than the writers’ own bug — the Publisher only renders a status field, it never kills anything on a false positive — but the same fix shape applies: read host first, and only fall back to kill -0 when it matches this container (or is absent, from a lock predating the stamp).

Fix: in scripts/publish-dashboard.sh, before the kill -0 check, compare lock.json’s host to $HOSTNAME; treat a lock naming a different host as not-alive-here without calling kill -0 at all, the same distinction acquire_lock now draws. docs/DASHBOARD-SPEC.md’s lock.json bullet (currently {pid, started_at}, no mention of host) needs updating alongside the fix.

Filed 2026-08-01, noticed while implementing TD-PPagop-26072901.