Draft
Fix weaver live-check RemoteDisconnected by reading report from stdout#5519
Conversation
When weaver v0.22.1 exits quickly after processing OTLP data, the POST to /stop gets a RemoteDisconnected error because weaver has already shut down its HTTP server. Fix: remove --output=http so weaver writes the JSON report to stdout on exit (default behavior). Add --no-stream to produce the full report as one JSON document. Rewrite _do_stop to signal /stop (ignoring connection errors), wait for process exit, then read the report from stdout. Update _read_weaver_logs to only read stderr since stdout now contains the JSON report. Assisted-by: Claude Sonnet 4.6 Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for opentelemetry-test-utils
Fix weaver live-check RemoteDisconnected by reading report from stdout
Aug 7, 2026
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
Member
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Weaver v0.22.1 exits ~1 second after processing all received OTLP data. The previous implementation retrieved the JSON report via HTTP response to
POST /stop, but by the timeweaver.end()called_do_stop(), weaver had already shut down its HTTP server — causingRemoteDisconnectedand a test failure intest_end_with_violations.Changes
--output=httpfrom the weaver command. Per weaver docs, the default behavior writes the JSON report to stdout on exit.--no-streamso the complete report is emitted as a single JSON document at shutdown rather than streamed piecemeal._do_stop:POST /stopis still sent to trigger an orderly shutdown, but connection errors are silently ignored (weaver may have already exited). The report is always read from stdout after process exit._read_weaver_logsto read only stderr — stdout now contains the structured JSON report, not human-readable logs.Type of change
How Has This Been Tested?
The existing test suite in
tests/opentelemetry-test-utils/tests/test_weaver_live_check.pycovers this — specificallyTestSDKInitLiveCheck::test_end_with_violations, which was the failing test.Does This PR Require a Contrib Repo Change?
Checklist: