The Fix
pip install urllib3==1.25
Based on closed urllib3/urllib3 issue #261 · 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%.
@@ -176,6 +176,18 @@ def test_connect_timeout(self):
+ def test_timeout_reset(self):
+ """ If the read timeout isn't set, socket timeout should reset """
+ url = '/sleep?seconds=0.005'
Option A — Upgrade to fixed release\npip install urllib3==1.25\nWhen NOT to use: Do not apply this fix if the behavior of timeouts needs to remain unchanged.\n\n
Why This Fix Works in Production
- Trigger: read timeout is not properly getting un-set
- Mechanism: The read timeout was not being reset, causing it to inherit the connect timeout
- Why the fix works: Reset the read timeout to ensure it does not inherit the connect timeout, addressing issue #261. (first fixed release: 1.25).
- 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
- The read timeout was not being reset, causing it to inherit the connect timeout
- Surfaces as: read timeout is not properly getting un-set
Proof / Evidence
- GitHub issue: #261
- Fix PR: https://github.com/urllib3/urllib3/pull/262
- First fixed release: 1.25
- 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.81
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Sounds like a problem indeed. Wanna write a test+fix? :D > It should be set instead to socket.getdefaulttimeout(). Hmm. I think if no timeout is…”
“Working on this now. On my machine at least socket.getdefaulttimeout() returns None. I figured to set it to getdefaulttimeout since this is the value that…”
“Right? There is, in theory, a difference between and”
“Hmm do you remember why we differentiated between None and _Default? No timeout should be 0, so None should be default... Also, could you change…”
Failure Signature (Search String)
- read timeout is not properly getting un-set
Error Message
Stack trace
Error Message
-------------
read timeout is not properly getting un-set
What Broke
Requests may hang indefinitely due to incorrect timeout settings.
Why It Broke
The read timeout was not being reset, causing it to inherit the connect timeout
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.25
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/urllib3/urllib3/pull/262
First fixed release: 1.25
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if the behavior of timeouts needs to remain unchanged.
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.
- Track RSS + object counts after deployments; alert on monotonic growth and GC pressure.
- Add a long-running test that repeats the failing call path and asserts stable memory.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.25 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.