-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
Worker.timeout_task interrupt subtasks if recursive is True and the task has subtasks.
The subtasks are set to INTERRUPTED but they should be set to TIMEOUT.
This is the current code of timeout_task:
def timeout_task(self, recursive=True):
"""Set the task state to timeout."""
try:
self.__lock(self.worker_id, new_state=TASK_STATES["TIMEOUT"], initial_states=(TASK_STATES["OPEN"], ))
except (MultipleObjectsReturned, ObjectDoesNotExist):
raise Exception("Cannot interrupt task %d, state is %s" % (self.id, self.get_state_display()))
if recursive:
for task in self.subtasks():
task.interrupt_task(recursive=True)
self.logs.gzip_logs()It's a very silly mistake, looks like it was copy and paste and someone forgot to change it.
Metadata
Metadata
Assignees
Labels
No labels