Skip to content

fix: don't fail over on client-side httpx errors (#143) - #147

Draft
tharropoulos wants to merge 2 commits into
typesense:masterfrom
tharropoulos:fix/143-client-side-errors
Draft

tharropoulos wants to merge 2 commits into
typesense:masterfrom
tharropoulos:fix/143-client-side-errors

Conversation

@tharropoulos

Copy link
Copy Markdown
Contributor

jaideeppyne and others added 2 commits August 24, 2026 14:25
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PoolTimeout and other client-side httpx errors mark a healthy node unhealthy and fail over

2 participants