The Fix
pip install redis==7.1.0
Based on closed redis/redis-py issue #3356 · 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%.
@@ -1356,7 +1356,7 @@ class BlockingConnectionPool(ConnectionPool):
self,
max_connections: int = 50,
- timeout: Optional[int] = 20,
+ timeout: Optional[float] = 20,
connection_class: Type[AbstractConnection] = Connection,
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: This fix should not be used if strict integer timeout values are required for compatibility.\n\n
Why This Fix Works in Production
- Trigger: BlockingConnectionPool timeout required to be an integer?
- Mechanism: The timeout parameter in BlockingConnectionPool was incorrectly type hinted as an integer instead of allowing float values
- Why the fix works: Changed the timeout typehint in async BlockingConnectionPool from int to float to allow for sub-second timeouts. (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 timeout parameter in BlockingConnectionPool was incorrectly type hinted as an integer instead of allowing float values
- Production symptom (often without a traceback): BlockingConnectionPool timeout required to be an integer?
Proof / Evidence
- GitHub issue: #3356
- Fix PR: https://github.com/redis/redis-py/pull/3801
- 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.81
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)
- BlockingConnectionPool timeout required to be an integer?
Copy-friendly signature
Failure Signature
-----------------
BlockingConnectionPool timeout required to be an integer?
Error Message
Signature-only (no traceback captured)
Error Message
-------------
BlockingConnectionPool timeout required to be an integer?
Environment
- Python: 3.5.1
What Broke
Developers faced issues with sub-second timeouts being rounded to integers, causing unexpected behavior.
Why It Broke
The timeout parameter in BlockingConnectionPool was incorrectly type hinted as an integer instead of allowing float values
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/3801
First fixed release: 7.1.0
Last verified: 2026-02-08. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if strict integer timeout values are required for compatibility.
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.