Skip to content

Commit

Permalink
Fix performance degradation when updating dagrun state (#8435)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Frank <dan.frank@coinbase.com>
  • Loading branch information
danfrankj and danfrankcb committed Apr 18, 2020
1 parent ddd005e commit dd9f04e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/models/dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ def update_state(self, session=None):
duration = (timezone.utcnow() - start_dttm)
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(
Expand Down

0 comments on commit dd9f04e

Please sign in to comment.