ephraimbuddy commented on a change in pull request #20391:
URL: https://github.com/apache/airflow/pull/20391#discussion_r781478095
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -289,7 +290,12 @@ def _executable_task_instances_to_queued(self, max_tis:
int, session: Session =
.filter(not_(DM.is_paused))
.filter(TI.state == TaskInstanceState.SCHEDULED)
.options(selectinload('dag_model'))
- .order_by(-TI.priority_weight, DR.execution_date)
+ .order_by(
+ TI.priority_weight.desc(),
+ desc(case([(TI.last_scheduling_decision.is_(None), 1)],
else_=0)),
+ TI.last_scheduling_decision.desc(),
Review comment:
Used nullsfirst for postgresql. I used it on the column directly instead
of using `airflow.utils.sqlalchemy.nulls_first` since we are sure it's postgres
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]