Skip to content

Commit bb1c314

Browse files
committed
fix: Redis connection crash from string keepalive option keys
redis-py 7.3.0 requires integer socket constants for socket_keepalive_options, not string keys like "TCP_KEEPIDLE". Removed custom keepalive options — socket_keepalive=True uses system defaults which are sufficient. This was causing all Redis operations to fail in production, breaking SSE streaming, billing cache, and agent state management.
1 parent aee7a46 commit bb1c314

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

backend/services/redis.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ async def initialize_async():
6969
retry_on_timeout=True, # Retry on timeout
7070
health_check_interval=30, # Health check every 30 seconds (optimized from 60)
7171
max_connections=128, # Connection pool size (increased from 50)
72-
socket_keepalive=True, # Enable TCP keepalive
73-
socket_keepalive_options={ # TCP keepalive options
74-
"TCP_KEEPIDLE": 60,
75-
"TCP_KEEPINTVL": 10,
76-
"TCP_KEEPCNT": 3,
77-
},
72+
socket_keepalive=True, # Enable TCP keepalive (system defaults)
7873
)
7974

8075
else:

0 commit comments

Comments
 (0)