The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #3366 · 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%.
@@ -2954,14 +2954,18 @@ def release(self, connection):
self._locked = False
- def disconnect(self):
- "Disconnects all connections in the pool."
+ def disconnect(self, inuse_connections: bool = True):
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: This fix is not applicable if the disconnect method's signature is intentionally designed to differ.\n\n
Why This Fix Works in Production
- Trigger: **Description**: Description of your issue, stack traces from errors and code that reproduces the issue
- Mechanism: The disconnect method in BlockingConnectionPool violates LSP due to mismatched arguments and behavior
- Why the fix works: Fixes the disconnect method in BlockingConnectionPool to adhere to the ConnectionPoolInterface, resolving issue #3366. (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
- Shows up under Python 3.5.1 in real deployments (not just unit tests).
- The disconnect method in BlockingConnectionPool violates LSP due to mismatched arguments and behavior
- Production symptom (often without a traceback): **Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Proof / Evidence
- GitHub issue: #3366
- Fix PR: https://github.com/redis/redis-py/pull/3802
- First fixed release: 7.1.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-08
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.80
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“This issue has been automatically marked as stale due to inactivity. It will be closed in 30 days if no further activity occurs. If you…”
Failure Signature (Search String)
- **Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Copy-friendly signature
Failure Signature
-----------------
**Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Error Message
Signature-only (no traceback captured)
Error Message
-------------
**Description**: Description of your issue, stack traces from errors and code that reproduces the issue
Environment
- Python: 3.5.1
What Broke
Inheriting from BlockingConnectionPool fails, preventing custom connection pool implementations.
Why It Broke
The disconnect method in BlockingConnectionPool violates LSP due to mismatched arguments and behavior
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/3802
First fixed release: 7.1.0
Last verified: 2026-02-08. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the disconnect method's signature is intentionally designed to differ.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- 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.
- 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.