You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/20 17:24:45 UTC

[GitHub] [airflow] mjpieters commented on issue #11633: Don't include upstream_failed in the 'active task instances' test in the scheduler

mjpieters commented on issue #11633:
URL: https://github.com/apache/airflow/issues/11633#issuecomment-713018792


   I've been running with the following patch for a few days now (added to `airflow_local_config.py` to ensure early loading):
   
   ```
   def airflow_issue_11633_upstream_failed_state():
       """The 'upstream_failed' state should be included in the 'finished' set"""
       from airflow.utils.state import State
   
       # in Airflow =<2.0.0a1, State.finished is a method, in future versions it is a frozenset.
       finished, is_set = State.finished, isinstance(State.finished, frozenset)
       if not is_set:
           finished = finished()
   
       if State.UPSTREAM_FAILED in finished:
           return
   
       if is_set:
           State.finished = frozenset([State.UPSTREAM_FAILED]) | State.finished
       else:
   
           @classmethod
           def finished_with_failed(cls):
               return [*finished, State.UPSTREAM_FAILED]
   
           State.finished = finished_with_failed
   
   
   airflow_issue_11633_upstream_failed_state()
   ```
   
   and I have not seen any adverse side effects so far.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org