Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel layers stop consuming messages from Redis #145

Closed
bashlakov opened this issue Dec 13, 2018 · 17 comments
Closed

Channel layers stop consuming messages from Redis #145

bashlakov opened this issue Dec 13, 2018 · 17 comments

Comments

@bashlakov
Copy link

Hi!
I've experience a problem similar to #1191
To reproduce this problem I've build a sandbox project based on chat example from official tutorial, you can see it here: https://github.com/bashlakov/django-channels-bug-demo

Steps to reproduce the problem:

Open http://localhost:8000/chat and create a new chat.
Open this chat in another tab. You send message in one tab and see it in this and in second tab.
Create a new different chat in new tab and send message to it.
Come back to first chat tab and continue to send messages. After sending several messages the chat brakes down and you can't send any new massages.
At this point you can browse you Redis and see, that messages stored in specific.* channels queues but not consumed by channel layers.
There is a video with this steps: https://youtu.be/DTFE-Up1De0

I've tried this example on Mac and Linux, using latest version of packages and python 3.5.2.
I've also tried to start the project with ./manage.py runserver, daphne and even uvicorn with no luck.
I found in-memory channel layers backend in sources and check again using this implementation instead of channels_redis. I can't reproduce bug with in-memory backend, so I think the problem is related to channels_redis.
Can you please try to reproduce this problem in your environment and confirm issue?

@nichoski
Copy link

nichoski commented Dec 22, 2018

I had this issue too a couple of weeks ago too. The only workaround I found was to use python 3.6.

@andrewgodwin
Copy link
Member

I've just tried to reproduce this locally and it works perfectly, though I am also on Python 3.6. Could you try on 3.6? 3.5 has a few problems with async to the point where we may have to stop supporting it.

@bashlakov
Copy link
Author

Confirm that upgrading python to 3.6 solve the problem. Not sure, is it correct to close this issue, because python 3.5 declared as supported version.

@andrewgodwin
Copy link
Member

I think I might just say 3.6 is required then.

@d-s-e
Copy link
Contributor

d-s-e commented Feb 12, 2019

I just tried the test example with Python 3.5.4, and it seems to work.
So it would be great, if we could change the requirement from 3.6 to 3.5.4.
The reason is, I have my app running on a system with python 3.5, and it's not that easy to bring that to 3.6.

@carltongibson
Copy link
Member

@d-s-e If you could pin this down to a specific change in 3.5.x that fixes the behaviour, and we can demonstrate that, then yeah, maybe we could lower the requirement.

Having said that, it's swimming against the tide at this point, so it'd have to be convincing and I'm not sure how long we could maintain it going forward...

@d-s-e
Copy link
Contributor

d-s-e commented Feb 12, 2019

Hm, I didn't want to dig that deep ;-)
Fact is, it's working with 3.5.4 but not with 3.5.3.
So it has to be a fix introduced in 3.5.4.

@carltongibson
Copy link
Member

Sure... but that's not quite enough to go on to say that we DO support the version, only to open up a whole raft of support requests and issues. It's just not worth it, we need to be sure.

@d-s-e
Copy link
Contributor

d-s-e commented Feb 12, 2019

Yes, you're right. But isn't just jumping direclty to 3.6 because "it works" just the same?
I don't have the time (and skills) to investigate this closer, so if this could cause trouble, just leave it as it is.
I have to pin to channels-redis 2.5.2 then.

@carltongibson
Copy link
Member

Hi @d-s-e. It's more about capacity at this point. Unless someone can do the leg work we just can't revisit a previous decision here, especially given that Python 3.5 is now on the wane. (Django's just dropped it going forward, a recent survey puts it at just 11% usage, and so on.) Sorry.

@d-s-e
Copy link
Contributor

d-s-e commented Feb 12, 2019

I fully understand the capacity problem, I can see it with my own time. I just thought, this could help others, having the the same issue. But I'm fine with that, thanks.

@darkfishy
Copy link

I am facing exactly this issue, though on Python 3.6.1, with following installed packages (including their dependencies):

channels==2.1.7
channels-redis==2.3.3
django==2.1.7
mysqlclient==1.4.1
requests==2.21.0

Those who have somehow solved their issue, which minor version of Python 3.6.y did you use?

@nichoski
Copy link

nichoski commented Feb 27, 2019 via email

@darkfishy
Copy link

@nichoski That was pretty quick response :-) I'll test with 3.6.4 and report back as soon as I can. Thanks.

@darkfishy
Copy link

I tested with Python 3.6.2, Python 3.6.3, Python 3.6.4 and Python 3.6.8. It works from 3.6.4 onwards. However I haven't yet been able to find the underlying reason why it would stop on prior versions of Python.

@seocam
Copy link

seocam commented May 8, 2019

Any suggestions to work that around with python 3.5.3 (current Python version in Debain 9)?

@m4rk3r
Copy link

m4rk3r commented Sep 8, 2020

I'm still experiencing this w/ both python 3.6.12 and python 3.8.2 is anyone else still running into this and have any possible workarounds?

related bits from pip freeze:

aioredis==1.3.1
asgiref==3.2.10
async-timeout==3.0.1
channels==2.4.0
channels-redis==3.0.1
daphne==2.5.0
Django==3.1
hiredis==1.1.0
redis==3.5.3
Twisted==20.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants