Skip to content

Commit

Permalink
Order TIs by map_index (#27904)
Browse files Browse the repository at this point in the history
(cherry picked from commit 820c5bb)
  • Loading branch information
tanelk authored and ephraimbuddy committed Jan 11, 2023
1 parent cc02bdc commit 5302cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/jobs/scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ 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, DR.execution_date, TI.map_index)
)

if starved_pools:
Expand Down

0 comments on commit 5302cc2

Please sign in to comment.