cameronmaske / celery-once

Celery Once allows you to prevent multiple execution and queuing of celery tasks.
https://pypi.python.org/pypi/celery_once/
BSD 2-Clause "Simplified" License
661 stars 90 forks source link

Missing apply_async ConnectionError handling #123

Open pkariz opened 4 years ago

pkariz commented 4 years ago

While calling apply_async i got this:

File "/usr/local/lib/python3.6/site-packages/redis/connection.py" in send_packed_command
  709.                                   (errno, errmsg))
Exception Type: OperationalError at <url>
Exception Value: Error 104 while writing to socket. Connection reset by peer.

and the key has been locked even though there was no task on the queue. I feel like here the case when apply_async call fails (doesn't push task on the queue) is not handled, so we end up in a state where the key is locked and we don't have the task in the queue. I haven't tried to reproduce this, maybe it's possible to just have redis settings point to an invalid endpoint.

skinderis commented 3 years ago

I have the same problem, when ConnectionError is raised task is remaining locked.