question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Error 110 while writing to socket. Connection timed out." With kombu 4.4.0/4.5.0 and redis 3.2.0/3.2.1

See original GitHub issue

I was previously on kombu 4.3.0 and redis 2.10.6, and after upgrading to kombu 4.4.0/4.5.0 and redis 3.2.0/3.2.1 I noticed a new issue on my Django REST endpoints:

Error 110 while writing to socket. Connection timed out.

These endpoints never had any issues before and this issue popped up only once since I upgraded, but happened on both endpoints simultaneously

Edit: Bug still there in most recent versions of the libraries (celery 4.3.0, kombu 4.5.0, redis 3.2.1) (I also had the bug when just upgrading kombu/redis and keeping celery at 4.2.2) Bug is not there in celery 4.2.2, kombu 4.3.0, redis 2.10.6

2019-05-21T07:51:02.022118+00:00 app[worker.1]: [2019-05-21 07:51:02,021: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (0/20) now.
2019-05-21T07:51:02.024750+00:00 app[worker.1]: [2019-05-21 07:51:02,024: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (1/20) in 1.00 second.
2019-05-21T07:51:03.028332+00:00 app[worker.1]: [2019-05-21 07:51:03,028: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (2/20) in 1.00 second.
2019-05-21T07:51:04.032513+00:00 app[worker.1]: [2019-05-21 07:51:04,032: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (3/20) in 1.00 second.
2019-05-21T07:51:05.037741+00:00 app[worker.1]: [2019-05-21 07:51:05,037: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (4/20) in 1.00 second.
2019-05-21T07:51:06.041513+00:00 app[worker.1]: [2019-05-21 07:51:06,041: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (5/20) in 1.00 second.
2019-05-21T07:51:07.045367+00:00 app[worker.1]: [2019-05-21 07:51:07,045: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (6/20) in 1.00 second.
2019-05-21T07:51:08.048339+00:00 app[worker.1]: [2019-05-21 07:51:08,048: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (7/20) in 1.00 second.
2019-05-21T07:51:09.052390+00:00 app[worker.1]: [2019-05-21 07:51:09,052: ERROR/ForkPoolWorker-5] Connection to Redis lost: Retry (8/20) in 1.00 second.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:53 (18 by maintainers)

github_iconTop GitHub Comments

8reactions
mlissnercommented, Aug 5, 2019

I’m unfortunately in no position to fix this, but I thought I’d at least make sure that the dots were connected between redis-py and here. Over on their upstream issue, they just did a release (3.3.0) with a new feature, and they say:

For Celery users, this change won’t automatically fix ConnectionErrors encountered by Celery. Celery uses PubSub in a non-standard way which can not take advantage of the automatic health checks at this time. Once this code is released, we should be able to create a PR for Celery to regularly call pubsub.check_health().

(https://github.com/andymccurdy/redis-py/issues/1140#issuecomment-515634842)

It’d be great to have Celery start using this functionality.

2reactions
alexandre-paroissiencommented, Jun 20, 2019

Right, for anyone reading this, it seems the issue appeared from the 3.x branch of redispy indeed (which is required by celery 4.3+ / kombu 4.4+), and the status of the issue is evolving there:

https://github.com/andymccurdy/redis-py/issues/1140

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Redis connection error in heroku - Stack Overflow
Error 110 while writing to socket. Connection timed out. I'm using the below packages with versions. python-3.6.8; Django-2.2.2; redis ...
Read more >
Error 110 while writing to socket. Connection timed out-django
There are several possible causes for this--the most usual occurs where you have lots of cache evictions caused by the maxmemory setting on...
Read more >
Change history — Kombu 5.2.4 documentation - Celery
When the SQS server returns a timeout we ignore it and keep trying instead of raising an error. This will prevent Celery from...
Read more >
Kombu Documentation - Read the Docs
Kombu is a messaging library for Python. The aim of Kombu is to make messaging in Python as easy as possible by providing...
Read more >
celery Changelog - pyup.io
Fix 'NoneType' object has no attribute 'can_read' bug of redis transport - Issue 1019 Fix redis transport socket timeout - Add wait timeout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found