Repository navigation
Hold an error reply's body to the same deadline as a success - #16506
Merged
Merged
Conversation
open_json read a successful body through _read_by, bounded by three times the socket timeout, but an HTTP error status read its body with error.read(), which only bounds each wait. A provider answering 429 or 500 and dripping its body held the collector, and the updater's wait held every later refresh behind it. Past the deadline the body is left out and the status still answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Contributor
[Medium impact] The PR appears safe to merge. Summary
Reviews (1) · Last reviewed commit: "Hold an error reply's body to the same d..." · Reviewed by Greptile |
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.
A follow-up to #14040, from reviewing it at 8d957f3.
open_jsoninshell/plugins/agents/collectors.pyreads a successful reply's body through_read_by, which stops at three times the socket timeout, because the socket timeout bounds only each wait and a server dripping a byte at a time would otherwise hold the collector forever. An HTTP error status skipped that: its body was read witherror.read(limit), bounded only per wait. A provider answering 429 or 500 and dripping its body held that collector indefinitely, and sinceomarchy-agent-usage-updatewaits on every collector and the panel queues refreshes behind a running update, every later refresh stalled with it.The error body now goes through
_read_byas well. Past the deadline it is left out, and theHttpErrorstill carries the status and headers, which is all any caller reads (Claude'sRetry-Afterhandling uses the headers; nothing reads the body). The new check inagent-usage-shared-test.shserves a 500 that drips its body and fails without the change.Codex Medium raised the defect in the review of #14040; Codex Medium and muse-spark-1.3 (pi, high) reviewed this change and found nothing to change.