feng-tao commented on a change in pull request #5016: [AIRFLOW-4194] Set
dag_run state to failed when user terminate backfill
URL: https://github.com/apache/airflow/pull/5016#discussion_r271148617
##########
File path: airflow/jobs.py
##########
@@ -2435,6 +2435,21 @@ def _execute_for_run_dates(self, run_dates, ti_status,
executor, pickle_id,
ti_status.executed_dag_run_dates.update(processed_dag_run_dates)
+ @provide_session
+ def _set_unfinished_dag_runs_to_failed(self, dag_runs, session=None):
+ """
+ Go through the dag_runs and update the state based on the
task_instance state.
+ Then set DAG runs that are not finished to failed.
+ :param dag_runs: DAG runs
+ :param session: session
+ :return: None
+ """
+ for dag_run in dag_runs:
+ dag_run.update_state()
Review comment:
cool, save lots of unnecessary code...
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services