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

Celery reconnecting #1018

Closed
imbolc opened this issue Apr 14, 2018 · 4 comments
Closed

Celery reconnecting #1018

imbolc opened this issue Apr 14, 2018 · 4 comments

Comments

@imbolc
Copy link
Contributor

imbolc commented Apr 14, 2018

I'm using redis as celerys broker and channels layers backend. After sending a channel message from celery task I see it reconnecting multiple times:

[2018-04-14 08:15:39,995: INFO/MainProcess] Received task: pong[923fcfde-b0f5-4d33-a3db-ed4f28aca71e]
[2018-04-14 08:15:40,004: DEBUG/MainProcess] Using selector: SelectSelector
[2018-04-14 08:15:40,006: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,006: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,024: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,024: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,042: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,043: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,062: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,063: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,083: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,084: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,104: DEBUG/MainProcess] Parsing Redis URI 'redis://localhost:6379/2'
[2018-04-14 08:15:40,105: DEBUG/MainProcess] Creating tcp connection to ('localhost', 6379)
[2018-04-14 08:15:40,132: INFO/MainProcess] Task pong[923fcfde-b0f5-4d33-a3db-ed4f28aca71e] succeeded in 0.13646206096746027s: None

If I set the same redis database for celery and channels I see much more such reconnections.

celery==4.1.0
channels==2.1.0
channels-redis==2.1.1

@andrewgodwin
Copy link
Member

I'm not sure there's anything we can do about this in Channels - I'm not familiar with how Celery uses Redis internally, but I know they use a different library to us to talk to it so I don't know why it would interfere like this.

@imbolc
Copy link
Contributor Author

imbolc commented Apr 14, 2018

Sure, but I was using channels from first version and there wasn't such issue. And after switching to channels-2 I found this. So I thought maybe something would come into your mind, some difference in how the second version works with redis or something like this.

@andrewgodwin
Copy link
Member

I'm afraid nothing immediately comes to mind - the difference between Channels 1 and 2 is vast (asyncio, Python 3 only, etc.) that there's no one thing that it could be.

@imbolc
Copy link
Contributor Author

imbolc commented Apr 15, 2018

I though it celery who was reconnecting, but actually it's channels-redis, and it isn't celery-specific. I've created an issue there: django/channels_redis#100

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

No branches or pull requests

2 participants