I am working on the project from chapters 12 - 17 of the book Django5 by Example. The book uses redis, however I have swapped-out redis for valkey in dockerized and non-dockerized versions of the project. My requirements include valkey, django-valkey, and channels-valkey.
I also have non-dockerized and dockerized project versions that employ redis.
Generally, the valkey version of the project performs the same as the redis version. However there is one issue.
The project has a chatroom with the standard channels/daphne server set-up one sees in so many channels tutorials.
I have encountered a bug in the valkey versions, and I do not know which part of the codebase of all the different valkey packages is responsible.
The bug:
When a chatroom is open, the websocket disconnects spontaneously - no user input necessary - after exactly 5 secs.
In my investigation I found, at around line 555 of site-packages/valkey/asyncio/connection.py, read_timeout is set to 5 (seconds) and self.protocol is set to 2. Inserting this code:
read_timeout = None
self.protocol = 3
… corrects the issue in the non-dockerized version, but not the dockerized version.
The valkey code is sprinkled at several points with a timeout variable of some type that is set to 5.
channels_valkey.core.py has this line:
brpop_timeout = 5
… however it has no other hard-coded timeout variables.
django-valkey does not appear to have any hard-coded timeout variables.
Microsoft Copilot and I are exhausted from troubleshooting this issue. I have made a bug report at valkey.io. Any insights from the collective membership here is appreciated.