Skip to content

fleet_logs_healthy trusts a stale ok:true peers marker, so a dead (not failing) fetch cron still reads as a healthy fleet log

Id: TD-PPagop-26082702 · Status: resolved · Filed: 2026-08-27 · Resolved: 2026-09-19 · Ref: https://github.com/Pullwright/agent-ops/pull/1692

Noticed while approving PR #823 (agent-ops#816). fleet_logs_healthy (lib/fleet.sh) reads the fleet_mark_peers marker’s .ok field but never its .ts. That covers the failure modes the #823 review named — an empty union, and a fetch cron that runs and fails (which writes ok:false) — but not a fetch cron that has stopped running altogether (crond dead, container half-up): the marker keeps its last ok:true indefinitely, the union stays populated with this node’s own log plus frozen peer trees, and the health gate passes. In that state requirement 38b’s live reconciliation is back to reading a peer’s silence as absence: a pair a peer applied more than LABEL_OWN_GRACE_SECONDS (30 min) before this node’s union_log_horizon, whose attempt-failed event is stranded on the dead fetch path, is classified orphaned and stripped — removing the log-independent blocked exclusion signal fleet-wide while the block is still live on the peer. Where: lib/fleet.sh fleet_logs_healthy (the marker read), fleet_peers_marker’s own header (which already anticipates a freshness reader), lib/candidate-gather.sh’s union_log_healthy gate, deploy/docker/crontab:55 (the 7-minute fetch interval a threshold would be measured in). Suggested fix: treat a marker whose ts is older than a small multiple of the fetch interval (e.g. 3–5 intervals, env-overridable) as unhealthy in fleet_logs_healthy, exactly as an ok:false marker is; pin it with a case in test/state-sync.test.sh’s fleet_logs_healthy block (an ok:true marker with an old ts reads unhealthy), and add the condition to requirement 38b’s gate sentence in docs/IMPLEMENTATION-PIPELINE-SPEC.md.

Noticed while the Approver was judging https://github.com/Poetic-Poems/agent-ops/pull/823.

Migrated to https://github.com/Poetic-Poems/agent-ops/issues/1001.