From c4a1671f8172fd1387f1125c24451785ea694e1b Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Fri, 30 Oct 2026 17:44:59 +0700 Subject: [PATCH] fix(ops): avoid false Cordn announce alerts from SIGPIPE --- scripts/host/relay-health.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/host/relay-health.sh b/scripts/host/relay-health.sh index 3f88fcd..812da97 100644 --- a/scripts/host/relay-health.sh +++ b/scripts/host/relay-health.sh @@ -53,9 +53,10 @@ avail=$(free -m | awk '/Mem:/{print $7}') cordn_rejects=$(docker logs --since 15m newlay-newlay-1 2>&1 | grep -c 'cordn rate limit' || true) [ "${cordn_rejects:-0}" -ge 40 ] && ISSUES+=("cordn rate limits: ${cordn_rejects} rejects in 15m") -if ! docker logs --since 20m newlay-newlay-1 2>&1 | grep -q 'cordn announce'; then - ISSUES+=("cordn coordinator has not announced in 20m") -fi +# `grep -q` + pipefail makes `docker logs` exit 141 on SIGPIPE, which used to +# make this check fire even when an announcement was present. Count instead. +cordn_announce=$(docker logs --since 20m newlay-newlay-1 2>&1 | grep -c 'cordn announce' || true) +[ "${cordn_announce:-0}" -eq 0 ] && ISSUES+=("cordn coordinator has not announced in 20m") # TLS expiry (Caddy auto-renews; this catches a broken renewal early). expiry=$(echo | openssl s_client -servername relay.skate-spots.org -connect relay.skate-spots.org:443 2>/dev/null \