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 2019/05/25 06:30:24 UTC

[GitHub] [airflow] milton0825 commented on a change in pull request #5323: [AIRFLOW-1464] Batch update task_instance state

milton0825 commented on a change in pull request #5323: [AIRFLOW-1464] Batch update task_instance state
URL: https://github.com/apache/airflow/pull/5323#discussion_r287553140
 
 

 ##########
 File path: airflow/jobs/backfill_job.py
 ##########
 @@ -341,13 +341,13 @@ def _task_instances_for_dag_run(self, dag_run, session=None):
         dag_run.refresh_from_db()
         make_transient(dag_run)
 
-        # TODO(edgarRd): AIRFLOW-1464 change to batch query to improve perf
         for ti in dag_run.get_task_instances():
             # all tasks part of the backfill are scheduled to run
             if ti.state == State.NONE:
-                ti.set_state(State.SCHEDULED, session=session)
+                ti.set_state(State.SCHEDULED, session=session, commit=False)
             if ti.state != State.REMOVED:
                 tasks_to_run[ti.key] = ti
+        session.commit()
 
 Review comment:
   Thanks for pointing that out.

----------------------------------------------------------------
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


With regards,
Apache Git Services