Closed dmzook closed 3 years ago
Subtasks are treated like regular functions so if you don't want them to trigger a failure you should use try...except...
.
def main_task(task: Task) -> Result:
try:
task.run(task=sub_task1) #fails on purpose
except Exception as e:
# I actually don't care if this happens and want to continue
pass
task.run(task=sub_task2)
As a matter of fact, a subtask failing shouldn't flag the host as failed. Only "main" tasks failures will, that is done by design so you can implement your own recovery logic/mechanisms easily.
There seems to be no way to continue grouped tasks if any of them fail. On the main task you can use 'on_failed=True' but that does not seem to work for grouped tasks.
Here I believe is the problem.
It will always kill a failed subtask and not allow more subtasks to be run.