Comments (6)
Upon further investigation the asgi_redis module is using 5s timeouts on BLPOP messages, which should keep the connection healthy, however I've seen cases where the connection is dropped and the BLPOP response is never received. In this case the worker would wait forever. Using the socket_timeout
option to the redis-py connection solves this issue, so I don't know if anything else is needed...
from channels_redis.
Yes, the pops are refreshed quite often, but the underlying socket connection is held open, and that might be what's dying. How did you add socket_timeout
- is it something we should support?
from channels_redis.
In the layer config, I used a connection URL to configure a host. Here we can pass query parameters such as socket_timeout=10
to redis-py. I don't think anything else needs to be done since this is backend specific.
from channels_redis.
Alright, lovely! Hopefully someone else can find that info useful too.
from channels_redis.
I've been running more tests and, although the socket_timeout solves the issue of the worker waiting forever, it seems that being able to configure the socket_keepalive_options parameter of redis-py would be helpful. Otherwise when an idle connection is dropped there's still a noticeable lag while waiting for the timeout on the next call, whereas if the dropped connection was detected earlier the experience would be better.
from channels_redis.
Alright - do you want to open a new ticket with the details of what kind of configuration options would be useful? I have some time tomorrow I can use to work those in (it would be nice to expose socket_timeout more directly too, potentially, and document it)
from channels_redis.
Related Issues (20)
- TimeoutError with pytest-asyncio when `group_discard` is used HOT 1
- In channels-redis==4.1.0, Cannot import BACKEND 'channels_redis.core.RedisChannelLayer' specified for default #2005 HOT 1
- `RedisChannelLayer.receive()` drops events due to `asyncio.shield()` in redis-py 4.5.4 HOT 10
- Failing test caused other tests to fail with RuntimeError: Event loop is closed on pytest HOT 5
- FYI: New Relic Python instrumentation breaks the PubSub layer with async consumers HOT 1
- Connection is None causing TypeError: object NoneType can't be used in 'await' expression HOT 1
- TypeError: AbstractConnection.__init__() got an unexpected keyword argument 'ssl_cert_reqs' HOT 2
- Inconsistent group_send behavior in RedisChannelLayer when called in consumer disconnect() HOT 1
- Connection reset by peer when upgrading redis-py to v5 HOT 6
- Serverless AWS Redis results in `redis.exceptions.ResponseError: Lua scripts without any input keys are not supported.` HOT 2
- Unable to configure AWS elasticache redis with channel_redis HOT 1
- redis.exceptions.ResponseError: unknown command 'BZPOPMIN' HOT 1
- support microsoft entra id for authentication with azure cache for redis HOT 1
- Use group_send() when group is empty. (Outside Of Consumers) HOT 1
- need for Advanced Redis configurations HOT 1
- When restart the server, channel information is not deleted. HOT 1
- Missing tag for 4.2.0 release HOT 1
- channels_redis keeps stale connection to redis HOT 1
- Crash in redis/asyncio/connection.py using Django Channels HOT 1
- NoPermissionError when using AWS ElastiCache HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from channels_redis.