deadman: NO contar farm-worker-loop como trabajo (3er bug del dead-man)
El loop del worker está SIEMPRE vivo (idle-loopea con la cola vacía). Contarlo en hay_trabajo() reseteaba los ticks a 0 cada 10 min ⇒ el worker NUNCA acumulaba idle ⇒ NUNCA se auto-mataba. Quedó 2h17m idle quemando € (2ª vez). El loop construyendo YA se detecta por su hijo `hammer build`; el loop vacío NO es trabajo. Se afina el match a `release/hammer.* build ` y se suma `campana-deuda`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Semantic delta
No definition changed: this change is text, documentation or data.
1 files · +7 −2
- scripts/farm/deadman.sh +7 −2
diff --git a/scripts/farm/deadman.sh b/scripts/farm/deadman.sh
index 5be2d38a..34967d7a 100644
--- a/scripts/farm/deadman.sh
+++ b/scripts/farm/deadman.sh
@@ -101,8 +101,13 @@ if [ "${1:-}" = "--verificar" ]; then
fi
hay_trabajo() {
- pgrep -f 'hammer build' >/dev/null 2>&1 && { echo "hammer build en vuelo"; return 0; }
- pgrep -f 'farm-worker-loop' >/dev/null 2>&1 && { echo "worker-loop vivo"; return 0; }
+ # `hammer build` cubre TODO el build (fetch/vendor/compile) porque el proceso vive toda la
+ # invocación. `campana-deuda` = campaña deliberada. NO se cuenta `farm-worker-loop`: ese loop
+ # está SIEMPRE vivo (idle-loopea con la cola vacía) ⇒ contarlo como trabajo hacía que el worker
+ # NUNCA acumulara ticks y NUNCA se matara — un worker con cola seca quedaba idle para siempre
+ # (incidente 2026-07-23, 2ª vez). El loop construyendo YA se ve por su `hammer build` hijo.
+ pgrep -f 'release/hammer.* build ' >/dev/null 2>&1 && { echo "hammer build en vuelo"; return 0; }
+ pgrep -f 'campana-deuda' >/dev/null 2>&1 && { echo "campaña deliberada en vuelo"; return 0; }
if [ -f "$HEARTBEAT" ]; then
edad=$(( $(date +%s) - $(stat -c %Y "$HEARTBEAT" 2>/dev/null || echo 0) ))
[ "$edad" -lt "$HEARTBEAT_MAX_AGE" ] && { echo "heartbeat fresco (${edad}s)"; return 0; }