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