You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/06/18 00:48:40 UTC

[airflow] 02/04: Fix performance degradation when updating dagrun state (#8435)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 354b58eb025673da1a15f429813d6721e534ca7b
Author: Daniel Frank <da...@airbnb.com>
AuthorDate: Sat Apr 18 11:58:37 2020 -0700

    Fix performance degradation when updating dagrun state (#8435)
    
    Co-authored-by: Dan Frank <da...@coinbase.com>
    (cherry picked from commit dd9f04e152997b7cff56920cb73c1e5b710a6f9d)
---
 airflow/models/dagrun.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/models/dagrun.py b/airflow/models/dagrun.py
index a4991d7..c5fcde5 100644
--- a/airflow/models/dagrun.py
+++ b/airflow/models/dagrun.py
@@ -300,7 +300,8 @@ class DagRun(Base, LoggingMixin):
         duration = (timezone.utcnow() - start_dttm).total_seconds() * 1000
         Stats.timing("dagrun.dependency-check.{}".format(self.dag_id), duration)
 
-        leaf_tis = [ti for ti in tis if ti.task_id in {t.task_id for t in dag.leaves}]
+        leaf_task_ids = {t.task_id for t in dag.leaves}
+        leaf_tis = [ti for ti in tis if ti.task_id in leaf_task_ids]
 
         # if all roots finished and at least one failed, the run failed
         if not unfinished_tasks and any(