JuConte
JuConte

Reputation: 542

How to revoke the task while running

When I send a task and I try to revoke:

app=Celery()
app.control.revoke(task.id)
#or
app.control.revoke(task.id, terminate=True)

I get that error:

[2019-09-05 05:27:50,110: ERROR/MainProcess] pidbox command error: NotImplementedError("<class 'celery.concurrency.gevent.TaskPool'> does not implement kill_job",)

I'm using gevent.

celery -A MyApp worker -l info -P gevent

what's wrong?

Upvotes: 3

Views: 2457

Answers (1)

DejanLekic
DejanLekic

Reputation: 19787

gevent concurrency does not allow killing of the jobs. Pre-fork does allow it as it is as simple as killing the worker-process that is running the task that you want to terminate, same goes for threading.

There is an issue about this, with a proposed solution - https://github.com/celery/celery/issues/4019 - but nobody made a PR.

Upvotes: 1

Related Questions