fix: don't fail over on client-side httpx errors (#143) - #147
Draft
tharropoulos wants to merge 2 commits into
Draft
tharropoulos wants to merge 2 commits into
tharropoulos wants to merge 2 commits into
Conversation
tharropoulos
commented
Oct 6, 2026
Contributor
- depends on fix: wait retry_interval_seconds between retries (#140) #141
- closes PoolTimeout and other client-side httpx errors mark a healthy node unhealthy and fail over #143
The httpx rewrite (v1.0.0) dropped the delay between retries that the requests-based client had. `_execute_request` recursed straight into the next attempt on a server error, so `retry_interval_seconds` was stored but never read. A node returning 503 or timing out received all attempts within milliseconds instead of being spaced out, and since each failed attempt marks the node unhealthy, every retry landed before the node had any chance to recover. Restore the wait in both the sync and async clients, sleeping only between attempts (num_retries < config.num_retries) so there is no needless delay before the final failure is raised. Also address the related config-key mismatch: `retry_interval_seconds` was read by Configuration but absent from ConfigDict (so the working key failed type checking), while the documented `interval_seconds` was in ConfigDict but never read. Add `retry_interval_seconds` to ConfigDict and honor both spellings, mirroring the earlier fix for `connection_timeout_seconds` (typesense#73). The async client is the unasync source of truth; add an asyncio->time token mapping so the generated sync client uses `time.sleep`. Adds regression tests for both the sync and async retry paths.
This branch has not been deployed
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.