fix(ci): remove wait from otelrecv cleanup; add pkill by name as fallback

wait "$RECV_PID" was blocking despite kill -9 (possibly because $RECV_PID
was garbled by ANSI escape codes from dagger output, making kill target the
wrong PID). Fix:
- Remove wait entirely — zombie is reaped when the shell exits
- Add pkill -9 -f otelrecv.py as fallback in case kill-by-PID misses
- Log PID at capture time to verify correctness in CI logs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-20 21:09:24 +02:00
co-authored by Claude Sonnet 4.6
parent 320fbcabc3
commit 0cb181b138
+3 -2
View File
@@ -290,10 +290,11 @@ tasks:
PORTFILE=$(mktemp)
python3 ci/otelrecv.py --port-file="$PORTFILE" &
RECV_PID=$!
echo "$(_ts) otelrecv started pid=$RECV_PID" >&2
cleanup() {
echo "$(_ts) cleanup: killing otelrecv pid=$RECV_PID" >&2
echo "$(_ts) cleanup: killing otelrecv (pid=$RECV_PID)" >&2
kill -9 "$RECV_PID" 2>/dev/null
wait "$RECV_PID" 2>/dev/null
pkill -9 -f "otelrecv.py" 2>/dev/null || true
echo "$(_ts) cleanup: done" >&2
rm -f "$PORTFILE" "$DAGGER_OUT" "$RC_FILE"
}