Skip to content

Commit f768a54

Browse files
gabbygator184KoalaSat
authored andcommitted
Fix Redis 8.x timeout in Channels
redis-py 8.0.0 changed default `socket_timeout` from None to 5 seconds. This causes a race condition with Django Channels' blocking Redis commands (BZPOPMIN/BRPOP with 5s server-side timeout), resulting in: `redis.exceptions.TimeoutError: Timeout reading from localhost:6379` Fix: Set `socket_timeout: None` in CHANNEL_LAYERS config to disable client-side timeout, allowing server-side blocking commands to complete. Source: redis/redis-py#4091
1 parent c49845c commit f768a54

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

robosats/settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@
254254
"default": {
255255
"BACKEND": "channels_redis.core.RedisChannelLayer",
256256
"CONFIG": {
257-
"hosts": [config("REDIS_URL")],
257+
"hosts": [
258+
{
259+
"address": config("REDIS_URL"),
260+
"socket_timeout": None,
261+
}
262+
],
258263
},
259264
},
260265
}

0 commit comments

Comments
 (0)