You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Deavarajegowda M T (JIRA)" <ji...@apache.org> on 2019/08/19 06:10:00 UTC

[jira] [Updated] (AIRFLOW-5222) Dag run status is wrongly set to SUCCESS

     [ https://issues.apache.org/jira/browse/AIRFLOW-5222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deavarajegowda M T updated AIRFLOW-5222:
----------------------------------------
    Attachment: example_branch_operator.py

> Dag run status is wrongly set to SUCCESS
> ----------------------------------------
>
>                 Key: AIRFLOW-5222
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5222
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>    Affects Versions: 1.10.3, 1.10.4
>            Reporter: Deavarajegowda M T
>            Priority: Minor
>         Attachments: example_branch_operator.py, image-2019-08-15-12-59-15-383.png
>
>
> !image-2019-08-15-12-59-15-383.png!
> In this particular case shouldn't  dag run status should be failed instead of success.
> Looks like in airflow on end tasks status are checked to decide on dag run status.
> root_ids = [t.task_id for t in dag.roots]
> roots = [t for t in tis if t.task_id in root_ids]
> # if all roots finished and at least one failed, the run failed
> if (not unfinished_tasks and
>  any(r.state in (State.FAILED, State.UPSTREAM_FAILED) for r in roots)):
>  self.log.info('Marking run %s failed', self)
>  self.set_state(State.FAILED)
>  dag.handle_callback(self, success=False, reason='task_failure',
>  session=session)



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)