Repository navigation
Keep the sender thread alive if _send ever raises - #7
Merged
Merged
Conversation
_drain now wraps each _send call in a try that logs at DEBUG and moves on, so the thread's survival no longer depends on every future edit to _send keeping all raising code inside its own try. No behavior change today. Closes #5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (the rubric below is scored against the PR head after CI went green):
Observations for the reviewer (judgment calls, not blocking):
Result: all rubric items pass with CI green. Merging needs a human, since this dispatch is not authorized to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
TraceClient._drainnow wraps eachself._send(body)call intry/except Exception: # noqa: BLE001, logging[trace] sender failed on ...atDEBUGand continuing the loop. The sender thread's survival no longer depends on every future edit to_sendkeeping all raising code inside its owntry._sendto raise once, then asserts thatthreading.excepthookis never called, that a later report is still delivered, and that the failure is logged atDEBUGonly._sendalready catches everything it can raise. Nothing Java-visible changed (wire format, opt-out values,disabled_reasonstrings and defaults are untouched), so no matching change is needed in trace-client-java.Closes #5
Test plan
python3 -m unittest -v: Ran 29 tests, OK (local interpreter)_drainchange stashed,test_the_sender_thread_survives_an_unexpected_error_from_sendFAILS; with it restored, the test PASSESBuildmatrixtest (3.8),test (3.10),test (3.12)greenThis PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson