mik-laj commented on a change in pull request #6954: [AIRFLOW-4355] removed task should not lead to dagrun success URL: https://github.com/apache/airflow/pull/6954#discussion_r362263999
########## File path: airflow/models/dagrun.py ########## @@ -311,32 +312,41 @@ def update_state(self, session=None): leaf_tis = [ti for ti in tis if ti.task_id in {t.task_id for t in dag.leaves}] - # if all roots finished and at least one failed, the run failed - if not unfinished_tasks and any( - leaf_ti.state in {State.FAILED, State.UPSTREAM_FAILED} for leaf_ti in leaf_tis - ): - self.log.info('Marking run %s failed', self) - self.set_state(State.FAILED) - dag.handle_callback(self, success=False, reason='task_failure', - session=session) - - # if all leafs succeeded and no unfinished tasks, the run succeeded - elif not unfinished_tasks and all( - leaf_ti.state in {State.SUCCESS, State.SKIPPED} for leaf_ti in leaf_tis - ): - self.log.info('Marking run %s successful', self) - self.set_state(State.SUCCESS) - dag.handle_callback(self, success=True, reason='success', session=session) - - # if *all tasks* are deadlocked, the run failed - elif (unfinished_tasks and none_depends_on_past and - none_task_concurrency and no_dependencies_met): - self.log.info('Deadlock; marking run %s failed', self) - self.set_state(State.FAILED) - dag.handle_callback(self, success=False, reason='all_tasks_deadlocked', - session=session) - - # finally, if the roots aren't done, the dag is still running + if conf.getboolean('scheduler', 'REMOVED_TASKS_LEAD_TO_DAGRUN_FAILURE', fallback=False): Review comment: The documentation structure is a topic that is not taken seriously yet, as there is a lack of documentation for a large part of the options. If you have no idea where to place the documentation, you can create a new document in the `docs/howto` directory. You can also call me and I will gladly give you tips in a specific situation. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services