The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #2814 · PR/commit linked
@@ -2143,6 +2143,8 @@ def _send_cluster_commands(
connection = get_connection(redis_node, c.args)
except ConnectionError:
+ for n in nodes.values():
+ n.connection_pool.release(n.connection)
# Connection retries are being handled in the node's
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not apply if the connection pool behavior is expected to change in future versions.\n\n
Why This Fix Works in Production
- Trigger: Connections are not released to a connection pool, when ClusterPipeline faces an exception on get_connection
- Mechanism: ClusterPipeline does not release connections to the pool after a ConnectionError occurs
- Why the fix works: Releases already acquired connections on ClusterPipeline when get_connection raises an exception, addressing a connection leak issue. (first fixed release: 7.1.0).
- If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).
Why This Breaks in Prod
- Shows up under Python 3.5.1 in real deployments (not just unit tests).
- ClusterPipeline does not release connections to the pool after a ConnectionError occurs
- Production symptom (often without a traceback): Connections are not released to a connection pool, when ClusterPipeline faces an exception on get_connection
Proof / Evidence
- GitHub issue: #2814
- Fix PR: https://github.com/redis/redis-py/pull/3133
- 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.67
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Hi @zakaf! First off, thank you for the report, and a potential bug fix. @dvora-h mind checking if this makes sense in the 4.6, and…”
“@zakaf this is still relevant and the fix makes sense... do you want to open a PR with the fix or wants me to take…”
“@dvora-h sorry for the delayed response. i've created #3133 to fix this issue”
Failure Signature (Search String)
- Connections are not released to a connection pool, when ClusterPipeline faces an exception on get_connection
- **Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Copy-friendly signature
Failure Signature
-----------------
Connections are not released to a connection pool, when ClusterPipeline faces an exception on get_connection
**Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Connections are not released to a connection pool, when ClusterPipeline faces an exception on get_connection
**Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Environment
- Python: 3.5.1
What Broke
Connections leak, causing resource exhaustion and potential service outages under high load.
Why It Broke
ClusterPipeline does not release connections to the pool after a ConnectionError occurs
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/3133
First fixed release: 7.1.0
Last verified: 2026-02-08. Validate in your environment.
When NOT to Use This Fix
- Do not apply if the connection pool behavior is expected to change in future versions.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- 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 |
|---|---|
| 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.