-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Limit number of retries #194
Comments
Is there a work around for this? |
Is there any update on this ? I have the exact same issue ... |
I honestly don't recall, but I don't think so. Sorry! |
No, I haven't found it. I just fixed that scenario where my task was failing and made sure that I covered all the scenarios that I could predict. An ugly workaround is to wrap your whole task code in a |
One way I resolved this issue is with a function called
I used it like this
This will make allow |
If you are using AWS SQS, my workaround is to make a deadletter queue and then on your task queue enable "use redrive policy" which "Sends messages into a dead letter queue after exceeding the Maximum Receives." Then set the maximum receives to the amount of retries you want to allow. |
@dangerski : I have the same problem but even if I configure AWS Queue to use redrive. It doesn't help. |
If a task fails with an exception, it is retried until it succeeds. This is contrary to what is said in the documentation: under the "Architecture" section, heading "Broker" it says that even when a task errors, it's still considered a successful delivery. Failed tasks never get acknowledged however, thereby being retried after the timeout period. See also issues Koed00#238 and Koed00#194. This patch adds an option to acknowledge failures, thereby closing issue Koed00#238. Issue Koed00#194 would require some more work. The default of this option is set to `False`, thereby maintaining backwards compatibility.
The ack_failure/ack_failures options do not work for tasks that fail due to timeout. After the worker is killed, tasks remain in the queue. Once the worker is reincarnated, it fetches the task, runs into timeout and the whole things starts all over again. |
@mm-matthias I have exactly the same problem. Have you found the solution for it? It there a way to specify number of retries before termination? |
@Waszker We are using celery/redis instead of django-q for more than a year, so I don't have a solution for this problem |
That'a a pity... Thanks for the answer though... |
i have a PR for a retry limit |
This can be closed |
When a task fails (like an unhandled exception) it is thrown in the failing jobs list but also retried. It doesn't seem there's any limit to the number of retries, and that means a job which is doomed to failure (due to my bad programming) continues to fail all day. I get a message sent to Rollbar each time, and that adds up to a lot of messages and eats my quota.
Is there a way to set a retry limit?
The text was updated successfully, but these errors were encountered: