You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/01/19 12:13:00 UTC

[jira] [Commented] (AIRFLOW-1298) Airflow Clear Command does not clear tasks in UPSTREAM_FAILED state

    [ https://issues.apache.org/jira/browse/AIRFLOW-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16747067#comment-16747067 ] 

ASF subversion and git services commented on AIRFLOW-1298:
----------------------------------------------------------

Commit 290579453508e0c1a472eb27bf8d7c14a8a4bd0d in airflow's branch refs/heads/v1-10-test from ubermen
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=2905794 ]

[AIRFLOW-1298] Clear UPSTREAM_FAILED using the clean cli (#3886)

* [AIRFLOW-1298] Fix 'clear only_failed'

* [AIRFLOW-1298] Fix 'clear only_failed'


> Airflow Clear Command does not clear tasks in UPSTREAM_FAILED state
> -------------------------------------------------------------------
>
>                 Key: AIRFLOW-1298
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1298
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: cli
>    Affects Versions: 1.8.0
>         Environment: Ubuntu 12.04, Kernel: 3.13.0-113-generic, python 2.7.10
>            Reporter: Aaditya Ramesh
>            Assignee: Aaditya Ramesh
>            Priority: Critical
>             Fix For: 2.0.0
>
>
> We are unable to clear airflow tasks that are in the UPSTREAM_FAILED state using the command line. The fix is simple - just change `clear` function in models.py to also clear tasks in UPSTREAM_FAILED state, not just FAILED.
> Diff:
> {noformat}
> diff --git a/airflow/models.py b/airflow/models.py
> index 30e18a44..e60d2918 100755
> --- a/airflow/models.py
> +++ b/airflow/models.py
> @@ -3180,7 +3180,7 @@ class DAG(BaseDag, LoggingMixin):
>          if end_date:
>              tis = tis.filter(TI.execution_date <= end_date)
>          if only_failed:
> -            tis = tis.filter(TI.state == State.FAILED)
> +            tis = tis.filter(TI.state == State.FAILED or TI.state == State.UPSTREAM_FAILED)
>          if only_running:
>              tis = tis.filter(TI.state == State.RUNNING)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)