The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #2901 · 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%.
@@ -44,6 +44,26 @@
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
when this client is closed, the internal connection pool remains open, i.e. its connections are not shut down.
The `Redis` class includes a `auto_close_connection_pool` argument. However, this is _ignored_ when a connection pool
is provided to the constructor. Presumably the thinking is that the caller will manage that pool himself.
But that makes the above kind of pattern, also used within the code, unusable.
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not use this fix if you require manual management of connection pools.\n\n
Why This Fix Works in Production
- Trigger: is closed, to free the user from such hassles. Examples in the code include
- Mechanism: The `auto_close_connection_pool` argument is ignored when a connection pool is provided to the Redis constructor
- Why the fix works: Adds a new `from_pool()` class method to the Redis client, allowing it to take ownership of a ConnectionPool and close it automatically, addressing issue #2901. (first fixed release: 7.1.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
- The `auto_close_connection_pool` argument is ignored when a connection pool is provided to the Redis constructor
- Production symptom (often without a traceback): is closed, to free the user from such hassles. Examples in the code include
Proof / Evidence
- GitHub issue: #2901
- Fix PR: https://github.com/redis/redis-py/pull/2913
- First fixed release: 7.1.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-08
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.70
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“This defect pertains to issues discovered with #2831 In async mode, it is important that a Redis object which holds its own pool, can be told to close it when the Redis object is closed, to free the user from such hassles. Examples in the c”
Failure Signature (Search String)
- is closed, to free the user from such hassles. Examples in the code include
- assert client.auto_close_connection_pool=False
Copy-friendly signature
Failure Signature
-----------------
is closed, to free the user from such hassles. Examples in the code include
assert client.auto_close_connection_pool=False
Error Message
Signature-only (no traceback captured)
Error Message
-------------
is closed, to free the user from such hassles. Examples in the code include
assert client.auto_close_connection_pool=False
Minimal Reproduction
when this client is closed, the internal connection pool remains open, i.e. its connections are not shut down.
The `Redis` class includes a `auto_close_connection_pool` argument. However, this is _ignored_ when a connection pool
is provided to the constructor. Presumably the thinking is that the caller will manage that pool himself.
But that makes the above kind of pattern, also used within the code, unusable.
What Broke
Redis clients do not automatically close their connection pools, leading to resource leaks.
Why It Broke
The `auto_close_connection_pool` argument is ignored when a connection pool is provided to the Redis constructor
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install redis==7.1.0
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/redis/redis-py/pull/2913
First fixed release: 7.1.0
Last verified: 2026-02-08. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if you require manual management of connection pools.
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 TLS smoke test that performs a real handshake in CI (include CA bundle validation and hostname checks).
- Alert on handshake failures by error string and endpoint to catch cert/CA changes quickly.
- Add a stress test that runs high-concurrency workloads and fails on thread dumps / blocked locks.
- Enable watchdog dumps in prod (faulthandler, thread dump endpoint) to capture deadlocks quickly.
Version Compatibility Table
| Version | Status |
|---|---|
| 7.1.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.