| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…bled
When a server crashes mid-request (e.g. SIGSEGV), httpx raises
RemoteProtocolError ("Server disconnected without sending a response").
This error was falling through to the catch-all Exception handler and
being wrapped as PermanentError, bypassing retry even when
retry_connection_errors=True.
This adds RemoteProtocolError to the list of retriable exceptions
alongside ConnectError and TimeoutException, in both sync and async
retry paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
LG! The release process in here is wonky. The build/publish jobs are triggered by touching RELEASES.md. You can just copy the last entry in there, nobody references the timestamps or Speakeasy versions.
Sorry, something went wrong.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tc.) (#334) ## Summary - Replaces individual `except` blocks for `ConnectError`, `RemoteProtocolError`, and `TimeoutException` with a single catch for their parent class `httpx.TransportError` - This covers `ReadError` (TCP connection reset mid-response with empty message), `WriteError`, and all other transport-level failures - Previously, `ReadError` fell through to the catch-all `Exception` handler and was wrapped as `PermanentError`, failing immediately without retry ## Context Follow-up to #332. After deploying the `RemoteProtocolError` fix, we observed `httpx.ReadError` (empty message) failures when api pods crashed mid-response. The TCP connection was reset during the response read phase, which httpx classifies as `ReadError` rather than `RemoteProtocolError`. The httpx exception hierarchy: ``` TransportError ├── ConnectError (was retried) ├── RemoteProtocolError (was retried since #332) ├── ReadError (was NOT retried — now fixed) ├── WriteError (was NOT retried — now fixed) ├── PoolTimeout (was NOT retried — now fixed) └── ... TimeoutException (was retried, subclass of TransportError) ├── ConnectTimeout ├── ReadTimeout ├── WriteTimeout └── PoolTimeout ``` Catching `TransportError` is the correct level — all transport errors are transient and should be retried when `retry_connection_errors=True`. ## Test plan - [x] Parametrized tests for all TransportError subclasses (sync + async) - [ ] Each subclass retried when `retry_connection_errors=True` - [ ] Each subclass raises immediately when `retry_connection_errors=False` 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Expands which network failures are treated as retryable, which can change error/latency behavior for callers and potentially mask persistent transport issues until backoff is exhausted. > > **Overview** > **Broadened retry handling for transport failures.** The retry wrapper now catches `httpx.TransportError` in both sync and async paths, so additional transport-level errors (e.g. `ReadError`, `WriteError`, and timeout subclasses) are retried when `retry_connection_errors=True` instead of being treated as permanent. > > Tests were updated to parameterize across multiple `TransportError` subclasses for both sync and async retry behavior, and the package version/release notes were bumped to `0.42.12`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit bdd403c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Summary
Context
When a server crashes mid-request (e.g. SIGSEGV from thread-unsafe native library access), the client receives an httpx.RemoteProtocolError("Server disconnected without sending a response."). Despite retry_connection_errors=True being configured, this error was not retried because the SDK only handled ConnectError and TimeoutException as retriable transport errors.
The httpx exception hierarchy is:
RemoteProtocolError is the same class of transient transport error as the already-retried exceptions.
Test plan
🤖 Generated with Claude Code
Note
Medium Risk
Changes retry behavior for mid-request disconnects, which can increase duplicate-request risk for non-idempotent operations when retry_connection_errors=True. Scope is limited to transport-error handling and covered by new unit tests for sync/async paths.
Overview
Retries now treat httpx.RemoteProtocolError as a retriable transport failure when retry_connection_errors=True, aligning it with existing ConnectError/TimeoutException handling in both retry and retry_async.
Adds unit tests validating the new sync/async retry behavior (and the disabled case), and bumps the SDK version to 0.42.11 with corresponding changelog/release entries and user-agent/version updates.
Written by Cursor Bugbot for commit a7dc972. This will update automatically on new commits. Configure here.