fix(ci): rename otelrecv→otel-receiver, fix teardown hang

Rename ci/otelrecv.py to ci/otel-receiver.py for readability.

Replace SIGTERM+wait shutdown (which could hang indefinitely) with an
HTTP-based approach: add GET /shutdown to otel-receiver.py that calls
self.server.shutdown() directly. After dagger call returns, curl that
endpoint so the receiver prints its timing report and exits cleanly.
Cleanup is reduced to a SIGKILL fallback in case the process is already
gone.

Also fix the do_GET handler to reference self.server instead of the
local variable server, which was inaccessible from the handler class.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-21 15:18:34 +02:00
co-authored by Claude Sonnet 4.6
parent f2d24a8514
commit 041e496e58
2 changed files with 13 additions and 9 deletions
+4 -4
View File
@@ -291,12 +291,10 @@ tasks:
exit $RC
fi
PORTFILE=$(mktemp)
python3 ci/otelrecv.py --port-file="$PORTFILE" &
python3 ci/otel-receiver.py --port-file="$PORTFILE" &
RECV_PID=$!
cleanup() {
kill "$RECV_PID" 2>/dev/null
wait "$RECV_PID" 2>/dev/null || true
pkill -9 -f "otelrecv.py" 2>/dev/null || true
kill -9 "$RECV_PID" 2>/dev/null || true
rm -f "$PORTFILE" "$DAGGER_OUT" "$RC_FILE"
}
trap cleanup EXIT
@@ -307,6 +305,8 @@ tasks:
OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf" \
dagger call --progress=plain -q -m ci --source=. check
RC=$?
curl -sf "http://127.0.0.1:$PORT/shutdown" >/dev/null 2>&1 || true
wait "$RECV_PID" 2>/dev/null || true
exit $RC
integration-android: