Closed
Description
We have an issue with daphne
opening connections to redis and (sometimes) never closing them. After a while, daphne cannot accept new connection and raises either OSError(24, 'Too many open files')
or MaxClientsError('ERR max number of clients reached')
.
This leak sometimes occurs when a WebsocketConsumer
closes the connection before accepting it (i.e. it rejects the connection).
I created a micro project to help reproduce this issue: https://github.com/simonbru/channels-redis-issue
I can reproduce the leak on channels-redis>=3.3.0
but not channels-redis==3.2.0
. To be more specific, I can reproduce the leak starting from this commit: 3656d87
Environment
- Debian 10
- Python 3.7
- Redis 6.2.1
Python dependencies
- aioredis==1.3.1
- channels==3.0.4
- channels-redis==3.3.0 (issue also occurs on latest commit: 781228c)
- daphne==3.0.2
- django==2.2.24
Configuration
- Channel backend:
channels_redis.core.RedisChannelLayer
Metadata
Metadata
Assignees
Labels
No labels