We have a dag that is scheduled to run every 30 minutes. The systems that the dag run uses (eg: MySql db) sometimes have to be taken offline (maintenance, patching, etc). What we would like to do is allow any dagruns that are currently "running" to complete but to not allow any subsequent runs.
Pausing/Disabling the DAG doesnt work, as it sets the next task that is to run to a state of "scheduled" and does not let the current dag-run to complete. What I am looking for is a way to let the entire current running dag-run to complete and no subsequent dag-runs to be triggered.
Seems like such "patching" work is probably something others need to do and I was wondering how you handle this situation, without adding a skip-step (eg: ShortCircuitOperator), that checks for a flag being set and skips subsequent runs. Ideally I was hoping for some kind of a Airflow or Dag level setting that allows us to basically allow the DAG to drain itself and not allow any new instances of DagRuns.
