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/02/07 10:30:33 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #7370: [AIRFLOW-6590] Use batch db operations in jobs

potiuk commented on a change in pull request #7370: [AIRFLOW-6590] Use batch db operations in jobs
URL: https://github.com/apache/airflow/pull/7370#discussion_r376320700
 
 

 ##########
 File path: airflow/jobs/base_job.py
 ##########
 @@ -280,19 +280,18 @@ def reset_state_for_orphaned_tasks(self, filter_by_dag_run=None, session=None):
             return []
 
         def query(result, items):
-            filter_for_tis = ([and_(TI.dag_id == ti.dag_id,
-                                    TI.task_id == ti.task_id,
-                                    TI.execution_date == ti.execution_date)
-                               for ti in items])
-            reset_tis = (
-                session
-                .query(TI)
-                .filter(or_(*filter_for_tis), TI.state.in_(resettable_states))
-                .with_for_update()
-                .all())
+            if not items:
 
 Review comment:
   Should not we leave the optimisation in place? It saves querying the database.

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