My requirement: I want to avoid overlapping task runs of the same task in airflow 2.1.4. The following run of a task should only start, after its preceding task_run finished (successfully or error is both ok). I found this comprehensive answer, but it doesn't seem to cover my use case efficiently: https://stackoverflow.com/a/56370721/17490201
What's NOT working for me:
'depends_on_past': True
because I want the following task_run to start, even if the previous one errored out.max_active_runs=1
because it's on DAG level. That means, if one single task is running unexpectedly long for whatever reason, it would delay the entire next dag_run and all of its task_runs. That's not desirable, because I don't want one single task to potentially affect all other tasks in said DAG.task_concurrency=1
per operator/task is what I want from a functional perspective, but I'd have to set it for every single operator (potentially over a hundred), which is repetitive and therefore inefficient (and annoying :P ).task_concurrency=1
set on DAG level results in an error. I was hoping, the argument was passed down to all tasks in that particular DAG.
Is there an elegant way to avoid overlapping taskruns without having to set/write/code it for every single operator/task?