django-react-boilerplate icon indicating copy to clipboard operation
django-react-boilerplate copied to clipboard

Consider using task_reject_on_worker_lost

Open fjsj opened this issue 3 years ago • 0 comments

From: https://docs.celeryproject.org/en/stable/userguide/tasks.html

Note that the worker will acknowledge the message if the child process executing the task is terminated (either by the task calling sys.exit(), or by signal) even when acks_late is enabled. This behavior is intentional as…

We don’t want to rerun tasks that forces the kernel to send a SIGSEGV (segmentation fault) or similar signals to the process.

We assume that a system administrator deliberately killing the task does not want it to automatically restart.

A task that allocates too much memory is in danger of triggering the kernel OOM killer, the same may happen again.

A task that always fails when redelivered may cause a high-frequency message loop taking down the system.

Solution is task_reject_on_worker_lost: https://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_reject_on_worker_lost

fjsj avatar Feb 10 '22 20:02 fjsj