From 6b0100ab0044d38fa06874c531346913db8ff4ee Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Sat, 14 Apr 2018 00:49:06 +0000 Subject: [PATCH] [Fix] Update 'trigger_rule' for Airflow Upgrade The current 'trigger_rule' is set to 'all_done' which means that this task will run even if one of the upstream tasks, e.g. 'drydock_build' failed (see [0] on how task is triggered). This is an incorrect behavior as task should only run if all upstream tasks have succeeded. This patch set is meant to correct this behavior. [0] https://airflow.incubator.apache.org/concepts.html#trigger-rules all_success: (default) all parents have succeeded all_failed: all parents are in a failed or upstream_failed state all_done: all parents are done with their execution one_failed: fires as soon as at least one parent has failed, it does not wait for all parents to be done one_success: fires as soon as at least one parent succeeds, it does not wait for all parents to be done dummy: dependencies are just for show, trigger at will Change-Id: I571271b79cece268ae039420e12327f187e8f35c --- shipyard_airflow/dags/common_step_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shipyard_airflow/dags/common_step_factory.py b/shipyard_airflow/dags/common_step_factory.py index b920d895..8453cbd0 100644 --- a/shipyard_airflow/dags/common_step_factory.py +++ b/shipyard_airflow/dags/common_step_factory.py @@ -207,7 +207,7 @@ class CommonStepFactory(object): return BranchPythonOperator(task_id=task_id, python_callable=upgrade_airflow_check, - trigger_rule="all_done", + trigger_rule="all_success", dag=self.dag) def get_upgrade_airflow(self, task_id=dn.UPGRADE_AIRFLOW):