Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -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):
repro.py
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'
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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
Production impact:
  • 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

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:”
Issue thread · issue description · source

Failure Signature (Search String)

  • 1196 raise ConnectionError("Too many connections")

Error Message

Stack trace
error.txt
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.txt
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

repro.py
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.

When NOT to use: This fix should not be used if the application does not require retry functionality.

Fix reference: https://github.com/redis/redis-py/pull/1604

Last verified: 2026-02-12. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be used if the application does not require retry functionality.

Verify Fix

verify
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.