Doing:
self.retry(exc=Exception("not_available"), args=[output_port, start_date, end_date, order_id], kwargs=kwargs, countdown=10)
celery just split the task, will retry the current one and will create a new one.
Now, why this happens? Cause the first time the task is called has
parameters in "kwargs" and get unpacked in function parameters. Calling
self.retry some "kwargs" are still there but others are moved in
function parameters, so Celery retry seems just to be a "Override this
task making an equal task" function...so you get 2 tasks:
def execute(self, output_port, start_date, end_date, order_id=None, **kwargs):
This is my task function, as i said, parameters are passed through "kwargs" that unpack them on "same name" function parameters.
EDIT:
forget to say, in retry i updated the parameter "order_id" once (first
time), so i need to retry with a filled order_id(first time is None).
So i get a task with order_id=None and a task with order_id="Filled_value".