The Fix
Fixes an issue with the 'retry' attribute in UnixDomainSocketConnection, resolving the TypeError encountered when using unix socket connections.
Based on closed redis/redis-py issue #1601 · 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%.
@@ -880,7 +880,13 @@ def __init__(self, path='', db=0, username=None, password=None,
retry_on_timeout=False,
parser_class=DefaultParser, socket_read_size=65536,
- health_check_interval=0, client_name=None):
+ health_check_interval=0, client_name=None,
+ retry=None):
1196 raise ConnectionError("Too many connections")
1197 self._created_connections += 1
-> 1198 return self.connection_class(**self.connection_kwargs)
1199
1200 def release(self, connection):
TypeError: __init__() got an unexpected keyword argument 'retry'
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Apply the official fix\nFixes an issue with the 'retry' attribute in UnixDomainSocketConnection, resolving the TypeError encountered when using unix socket connections.\nWhen NOT to use: This fix should not be used if the application does not require retry functionality.\n\n
Why This Fix Works in Production
- Trigger: 1196 raise ConnectionError("Too many connections")
- Mechanism: The UnixDomainSocketConnection class did not accept a 'retry' argument, causing a TypeError
- 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 UnixDomainSocketConnection class did not accept a 'retry' argument, causing a TypeError
- Surfaces as: 1196 raise ConnectionError("Too many connections")
Proof / Evidence
- GitHub issue: #1601
- Fix PR: https://github.com/redis/redis-py/pull/1604
- Reproduced locally: No (not executed)
- Last verified: 2026-02-12
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.49
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“**redis-py 3.9.9, redis 6.2.6** When I tried to use unix socket connection: I got error: almost same using UnixDomainSocketConnection:”
Failure Signature (Search String)
- 1196 raise ConnectionError("Too many connections")
Error Message
Stack trace
Error Message
-------------
1196 raise ConnectionError("Too many connections")
1197 self._created_connections += 1
-> 1198 return self.connection_class(**self.connection_kwargs)
1199
1200 def release(self, connection):
TypeError: __init__() got an unexpected keyword argument 'retry'
Stack trace
Error Message
-------------
1035 try:
-> 1036 return conn.retry.call_with_retry(
1037 lambda: self._send_command_parse_response(conn,
1038 command_name,
AttributeError: 'UnixDomainSocketConnection' object has no attribute 'retry'
Minimal Reproduction
1196 raise ConnectionError("Too many connections")
1197 self._created_connections += 1
-> 1198 return self.connection_class(**self.connection_kwargs)
1199
1200 def release(self, connection):
TypeError: __init__() got an unexpected keyword argument 'retry'
What Broke
Users experienced TypeErrors when attempting to connect via Unix socket.
Why It Broke
The UnixDomainSocketConnection class did not accept a 'retry' argument, causing a TypeError
Fix Options (Details)
Option A — Apply the official fix
Fixes an issue with the 'retry' attribute in UnixDomainSocketConnection, resolving the TypeError encountered when using unix socket connections.
Fix reference: https://github.com/redis/redis-py/pull/1604
Last verified: 2026-02-12. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the application does not require retry functionality.
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
- 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.
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.