Uh oh!
There was an error while loading. Please reload this page.
fix: Fail fast on transport errors a retry cannot fix - #1019
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #1019 +/- ##
==========================================
- Coverage 94.87% 94.85% -0.03%
==========================================
Files 58 58 Lines 5367 5365 -2 ==========================================
- Hits 5092 5089 -3 - Misses 275 276 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
August 18, 2026 13:52
Pijukatel
approved these changes
Aug 18, 2026
vdusek added a commit
that referenced
this pull request
Aug 18, 2026
`_utils/errors.py::is_retryable_error` is a stale copy of `http_clients/_impit.py::_is_retryable_error`. No production code calls it — only its own tests did — and it sits in a private module, so nothing depends on it. Once #1019 narrows the real policy, keeping a second copy that still claims every `impit.HTTPError` is transient is actively misleading. Removes the function, its two test cases, and the imports they alone needed. Split out of #1006. *✍️ Drafted by Claude Code*
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 18, 2026
vdusek added a commit
that referenced
this pull request
Aug 19, 2026
Moves `call`, the retry loop, and the per-attempt request handling from `ImpitHttpClient` and `ImpitHttpClientAsync` into `HttpClient` and `HttpClientAsync`, leaving Impit as a thin adapter over the transport hooks: `send_request`, `is_retryable_transport_error`, `is_timeout_error`, and `close()` / `aclose()` plus context managers. A custom client that overrides `call` keeps working unchanged and opts out of the shared pipeline. `StreamedLog` classifies timeouts through the transport-neutral `is_timeout_error` hook instead of importing Impit. No behavior change for the built-in clients: the retry policy shipped in #1019 (permanent transport errors fail fast) and #1020 (a failed read of a streamed error body is classified like a failed send and the response is closed) is preserved — the classification now lives in the `is_retryable_transport_error` hook, and the error-body read handling in the shared pipeline. Supersedes #1011, rebased onto current master and squashed. Originally split out of #1006. *✍️ Drafted by Claude Code*
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 freeto 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.
Every
impit.HTTPErrorcounted as transient, so a transport failure a retry cannot fix burned the whole backoff before surfacing. The permanent classes now fail on the first attempt instead:LocalProtocolError- a request Impit rejects before sending it, e.g. one carrying an invalid header value.TooManyRedirects- a routing loop, which repeating the request cannot break.UnsupportedProtocol- the class Impit declares for a scheme it refuses to speak, but does not raise today; an unsupported scheme arrives asimpit.InvalidURL, outside theimpit.HTTPErrortree and non-retryable already. Listed so the classifier stays right if Impit switches over.HTTPStatusError- onlyResponse.raise_for_status()raises it and the client never calls it;_make_requestdecides on status codes from the response itself.Everything else in the
impit.HTTPErrortree stays retryable, including a bareHTTPError- Impit wraps a failure its internal HTTP library did not classify in one, e.g. a non-HTTP response or a connection reset - and aProxyError, which covers a rejected CONNECT tunnel and a 407 alike, so a transient case cannot be told from a permanent one.Also drops
InvalidResponseBodyErrorfrom the retry check. Onlykey_value_store.pyraises it, oncecallhas already returned, so it can never reach the classifier. Its docstring no longer claims the client retries such requests. The duplicateis_retryable_errorin_utils/errors.py, which carried the old policy, is gone.Split out of #1006 and re-targeted at
master, so the retry fixes can ship in a patch release ahead of the pipeline refactor in #1011.✍️ Drafted by Claude Code