Jump to solution
Details

The Fix

pip install urllib3==1.25.11

Based on closed urllib3/urllib3 issue #1838 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Open PR/Commit
@@ -916,7 +916,7 @@ def socket_handler(listener): release_conn=False, preload_content=False, - timeout=Timeout(connect=LONG_TIMEOUT, read=SHORT_TIMEOUT), + timeout=LONG_TIMEOUT, )
fix.md
Option A — Upgrade to fixed release\npip install urllib3==1.25.11\nWhen NOT to use: Do not use this fix if the timeout settings are already appropriate for your environment.\n\n

Why This Fix Works in Production

  • Trigger: __ TestSocketClosing.test_release_conn_param_is_respected_after_timeout_retry __
  • Mechanism: The test was using a short read timeout, causing premature timeouts during retries
  • Why the fix works: Addresses the timeout issue in the PyPy test by using a longer timeout setting for the test case. (first fixed release: 1.25.11).
Production impact:
  • If left unfixed, retry loops can amplify load and turn a small outage into a cascade (thundering herd).

Why This Breaks in Prod

  • The test was using a short read timeout, causing premature timeouts during retries
  • Surfaces as: __ TestSocketClosing.test_release_conn_param_is_respected_after_timeout_retry __

Proof / Evidence

  • GitHub issue: #1838
  • Fix PR: https://github.com/urllib3/urllib3/pull/1956
  • First fixed release: 1.25.11
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.95
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.40

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Fixed in https://github.com/urllib3/urllib3/pull/1956”
@pquentin · 2020-09-10 · confirmation · source

Failure Signature (Search String)

  • __ TestSocketClosing.test_release_conn_param_is_respected_after_timeout_retry __

Error Message

Stack trace
error.txt
Error Message ------------- __ TestSocketClosing.test_release_conn_param_is_respected_after_timeout_retry __ Traceback (most recent call last): File "/home/travis/build/urllib3/urllib3/.nox/test-pypy/site-packages/urllib3/connectionpool.py", line 431, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/home/travis/build/urllib3/urllib3/.nox/test-pypy/site-packages/urllib3/connectionpool.py", line 426, in _make_request httplib_response = conn.getresponse() File "/opt/python/pypy3.5-6.0.0/lib-python/3/http/client.py", line 1198, in getresponse response.begin() File "/opt/python/pypy3.5-6.0.0/lib-python/3/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/opt/python/pypy3.5-6.0.0/lib-python/3/http/client.py", line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") File "/opt/python/pypy3.5-6.0.0/lib-python/3/socket.py", line 576, in readinto return self._sock.recv_into(b) _socket.timeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/travis/build/urllib3/urllib3/.nox/test-pypy/site-packages/urllib3/connectionpool.py", line 682, in urlopen chunked=chunked, File "/home/travis/build/urllib3/urllib3/.nox/test-pypy/site-packages/urllib3/connectionpool.py", line 433, in _make_request sel ... (truncated) ...

What Broke

Tests hang or fail due to read timeouts, impacting CI reliability.

Why It Broke

The test was using a short read timeout, causing premature timeouts during retries

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install urllib3==1.25.11

When NOT to use: Do not use this fix if the timeout settings are already appropriate for your environment.

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/1956

First fixed release: 1.25.11

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use this fix if the timeout settings are already appropriate for your environment.

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

VersionStatus
1.25.11 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.