django celery terminate task's subprocesses

admin

Administrator
Staff member
This is a follow-up question to my previous question:
<a href="https://stackoverflow.com/questions...dy-executing-task-with-celery/8924116#8924116">Cancel an already executing task with Celery?</a>

Code:
celery.task.control.revoke({task_id}, terminate=True)

does indeed kill my worker running the task. I am now having the issue that my task is running subprocesses that do not die when the task is revoked.

This post by dmarkey
<a href="http://dmarkey.com/wordpress/2011/09/07/killing-child-processes-of-celery-tasks-on-a-timeout/" rel="nofollow noreferrer">http://dmarkey.com/wordpress/2011/09/07/killing-child-processes-of-celery-tasks-on-a-timeout/</a>
is the closest I've seen to what I want to do, except I don't want to kill on timeout, but rather when I revoke() with the task_id.

Seeming that all I have is the (String) task_id, is there anyway to kill such subprocesses? Thanks for your help - I don't have quite as much experience with this as I'd like, navigating the docs is a challenge!