2👍
✅
You should use terminate
to kill an already started task.
revoke:
>>> from celery.task.control import revoke
>>> revoke(task_id)
When a worker receives a revoke request it will skip executing the task, but it won’t terminate an already executing task.
terminate:
>>> from celery.task.control import revoke
>>> revoke(task_id, terminate=True)
If terminate is set the worker child process processing the task will be terminated. The default signal sent is TERM. Terminating a task also revokes it.
kill:
This is different from the above two. KILL
is used to kill workers
ps auxww | grep 'celery worker' | awk '{print $2}' | xargs kill -9
Source:stackexchange.com