The Fix
Upgrade to version 0.13.0 or later.
Based on closed encode/httpx issue #435 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -250,83 +250,78 @@ async with httpx.Client(proxies=proxy) as client:
information at `Client` initialization.
-## Timeout fine-tuning
+## Timeout Configuration
>> import httpx
>> httpx.config.DEFAULT_TIMEOUT_CONFIG
TimeoutConfig(timeout=5.0)
>> httpx.TimeoutConfig(read_timeout=1)
# We'd expect connect_timeout and write_timeout to be 5 (the default)
TimeoutConfig(connect_timeout=None, read_timeout=1, write_timeout=None)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.13.0 or later.\nWhen NOT to use: This fix is not suitable if you require completely custom timeout behavior without defaults.\n\n
Why This Fix Works in Production
- Trigger: Fine-tuning timeouts from the default timeout config
- Mechanism: TimeoutConfig did not use default values for unspecified timeouts
- Why the fix works: Allows users to create a TimeoutConfig with default values for unspecified timeouts, addressing issue #435. (first fixed release: 0.13.0).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- TimeoutConfig did not use default values for unspecified timeouts
- Production symptom (often without a traceback): Fine-tuning timeouts from the default timeout config
Proof / Evidence
- GitHub issue: #435
- Fix PR: https://github.com/encode/httpx/pull/593
- First fixed release: 0.13.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.65
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“And so we'd have: This looks like a nice approach to me. I suppose we'd get rid of DEFAULT_TIMEOUT_CONFIG entirely and use TimeoutConfig() instead?”
“What about making TimeoutConfig(read_timeout=1) result in 5, 1, 5 instead of None, 1, None? Then you have to be explicit about the other two if…”
“Simplest question is, what do we want this to return?... I *think* we should probably switch things around so that it'll give you TimeoutConfig(timeout=5) rather…”
Failure Signature (Search String)
- Fine-tuning timeouts from the default timeout config
- Currently, if we want to change only one of the three timeouts (connect, read, write) we need to build a full-blown `TimeoutConfig`. But there is no way to use the default timeout
Copy-friendly signature
Failure Signature
-----------------
Fine-tuning timeouts from the default timeout config
Currently, if we want to change only one of the three timeouts (connect, read, write) we need to build a full-blown `TimeoutConfig`. But there is no way to use the default timeout values.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Fine-tuning timeouts from the default timeout config
Currently, if we want to change only one of the three timeouts (connect, read, write) we need to build a full-blown `TimeoutConfig`. But there is no way to use the default timeout values.
Minimal Reproduction
>> import httpx
>> httpx.config.DEFAULT_TIMEOUT_CONFIG
TimeoutConfig(timeout=5.0)
>> httpx.TimeoutConfig(read_timeout=1)
# We'd expect connect_timeout and write_timeout to be 5 (the default)
TimeoutConfig(connect_timeout=None, read_timeout=1, write_timeout=None)
What Broke
Users faced issues when trying to set individual timeouts without default values.
Why It Broke
TimeoutConfig did not use default values for unspecified timeouts
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.13.0 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/encode/httpx/pull/593
First fixed release: 0.13.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not suitable if you require completely custom timeout behavior without defaults.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
- Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
- Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.13.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.