From 0cc222ab8b941153598325a95a821a9faa9d73b8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 08:48:05 +0200 Subject: [PATCH] Stop ygg-verify printing "Terminated" on every run The watchdog subshell reported its own killed sleep as "Terminated" on every job, successful or not. Agents read that as the job failing: one Hands reported "the script reports exit 0 after Terminated even when the job fails", which is false. Tested: exit 3 gives rc 3, and true gives rc 0. Now the subshell's stderr is /dev/null and the TIMEOUT notice goes out through fd 3. Checked: TIMEOUT=20 on sleep 60 prints TIMEOUT and exits 137, and a clean run prints no stray line. The watchdog is also reaped with wait. Co-Authored-By: Claude Opus 5.5 --- tools/stopgap/ygg-verify.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/stopgap/ygg-verify.sh b/tools/stopgap/ygg-verify.sh index a8de898..9bbefa6 100644 --- a/tools/stopgap/ygg-verify.sh +++ b/tools/stopgap/ygg-verify.sh @@ -131,7 +131,7 @@ echo "ygg-verify: $name@${sha:0:10} slot $slot, image $image, cpus $cpus, mem $m cname="eureka-verify-$slot-$$" # The subshell must not inherit the slot lock: its sleep outlives a job that # finishes early, and an inherited fd held slot 2 for an hour (2026-09-23). -( exec {fd}>&-; sleep "$timeout_s"; sudo docker kill "$cname" >/dev/null 2>&1 && echo "ygg-verify: TIMEOUT after ${timeout_s}s, container killed" >&2 ) & +( exec {fd}>&- 2>/dev/null; sleep "$timeout_s"; sudo docker kill "$cname" >/dev/null 2>&1 && echo "ygg-verify: TIMEOUT after ${timeout_s}s, container killed" >&3 ) 3>&2 & watchdog=$! set +e sudo nice -n 10 docker run --rm --name "$cname" --cpus="$cpus" --memory="$mem" \ @@ -145,6 +145,10 @@ status=$? set -e pkill -P "$watchdog" 2>/dev/null || true kill "$watchdog" 2>/dev/null || true +# Reap it. The subshell's own stderr is /dev/null, so killing its sleep +# prints no "Terminated" (agents misread that as a failed job); the TIMEOUT +# notice goes out through fd 3. +wait "$watchdog" 2>/dev/null || true echo "ygg-verify: exit $status" >&2 echo "__YGG_VERDICT__ $status" exit $status