Claude/finish query callback logs a5f2m6 - #145
Merged
Merged
Conversation
The async callback POST was a black box: one INFO line on success with no duration, and a failure line whose only detail was the raw exception. Nothing this worker logged was persisted either -- it acks directly rather than going through wrap_up_task, so its records never reached the query's log list. Now, after each attempt completes: - success logs the elapsed time, payload size and attempt number, plus a summary line when it took more than one attempt; - failure logs the elapsed time and a bounded reason -- HTTP status with the head of the server's response body, or the httpx exception class (connect and timeout errors routinely stringify to nothing); - a single "gave up" line records that the response was never delivered; - the same numbers go on the otel span as attributes, so timing is queryable without adding per-query log storage. A failed attempt's note is also spliced into the next attempt's payload, so a receiver that eventually gets the response can see the attempts that didn't make it. Splicing rebuilds the buffer, so it's skipped above 64 MiB -- the transient second copy would cost more than the note is worth, and the note is in the query's logs either way. Memory-wise this is a net improvement: the logs list and its serialization are dropped once they're inside the payload instead of being held for the length of the POST, the payload is released before the closing db round trips, and the log flush drains a handler queue that this worker previously left to accumulate. Also stop sleeping after the final failed attempt, and make the fallback serialization put "logs" last so the retry splice has a predictable tail.
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
No description provided.