dstandish commented on code in PR #36566:
URL: https://github.com/apache/airflow/pull/36566#discussion_r1442045713


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1644,13 +1644,10 @@ def adopt_or_reset_orphaned_tasks(self, session: 
Session = NEW_SESSION) -> int:
 
                     query = (
                         select(TI)
+                        .options(lazyload("dag_run"))  # avoids double join to 
dag_run
                         .where(TI.state.in_(State.adoptable_states))
-                        # outerjoin is because we didn't use to have 
queued_by_job
-                        # set, so we need to pick up anything pre upgrade. 
This (and the
-                        # "or queued_by_job_id IS NONE") can go as soon as 
scheduler HA is
-                        # released.

Review Comment:
   good idear. yeah i'll add. re whether "this" happened, AFAICT "this" was 
airflow 2.0



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

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

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

Reply via email to