Unify executor workload queues - #63491
Merged
Merged
Conversation
anishgirianish
requested review from
XD-DENG,
ashb,
dheerajturaga,
hussein-awala,
jedcunningham,
jscheffl,
o-nikolas and
pierrejeambrun
as code owners
March 12, 2026 23:22
jscheffl
previously requested changes
Mar 12, 2026
anishgirianish
commented
Mar 12, 2026
1 task
anishgirianish
force-pushed
the
refactor-workload-queue
branch
from
March 12, 2026 23:39
85bfce8 to
1ce0748
Compare
ferruzzi
reviewed
Mar 12, 2026
ferruzzi
left a comment
Contributor
There was a problem hiding this comment.
Made a real quick pass and left some comments and questions, I'll try to get a more thorough one tomorrow.
anishgirianish
force-pushed
the
refactor-workload-queue
branch
3 times, most recently
from
March 13, 2026 06:02
aee94fb to
8997ee4
Compare
anishgirianish
marked this pull request as draft
March 13, 2026 07:43
anishgirianish
force-pushed
the
refactor-workload-queue
branch
6 times, most recently
from
March 14, 2026 04:40
11ee7ef to
249b014
Compare
anishgirianish
marked this pull request as ready for review
March 14, 2026 05:45
1 task done
kaxil
reviewed
Sep 10, 2026
Contributor
Author
|
@kaxil thank you very much for the review. I have addressed all the feedbacks, Would like to request you for another round when ever you get a chance. thank you |
kaxil
reviewed
Sep 14, 2026
…add a note to clearify the change in queued task priority in base executer
The new API ships in Airflow 3.4, not 3.3 as assumed when the guards were written, so providers failed to import against released 3.3.0.
The rebase onto main brought in apache#70942, which flipped queued-task dispatch to highest priority_weight first, but the unified sort_key still sorted ascending and would have silently reverted that fix.
…ion_tests overrides
Contributor
Author
|
@kaxil thank you so much for the re-review and the merge. I really appreciate it. thank you |
1 task
9 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was generative AI tooling used to co-author this PR?
Summary
Refactors
BaseExecutorworkload queue management so that adding a new workload type is a small.Follows the direction proposed by @ferruzzi #62343 (comment).
Problem
Adding a new workload type (like ExecuteCallback or TestConnection) required touching ~6 places in BaseExecutor: a new queue dict, a new
supports_*flag,slots calculation, an isinstance branch in queue_workload, a dedicated scheduling method, and isinstance branches in dequeue/trigger logic. Each provider executor that overrodequeue_workloadalso needed updating. This made extending the executor interface unnecessarily painful.What this does
Replaces the per-type queue dicts and boolean capability flags with three primitives:
executor_queues: onedefaultdict(dict)keyed byWorkloadType, replacingqueued_tasks,queued_callbacksandqueued_connection_tests.supported_workload_types: afrozenset[WorkloadType]replacingsupports_callbacksandsupports_connection_test.WORKLOAD_TYPE_PRIORITYplus a per-schemasort_key: the type registry decides ordering across types, the schema decides ordering within a type.queue_workloadin the base class is now generic: validate the type, store by key.trigger_tasksandtrigger_connection_testsare merged intotrigger_workloads, which drains all queue types through a single per-heartbeat budget.Adding a new workload type after this refactor
WorkloadTypemember and place it in_workload_type_priority_order.AllandExecutorWorkloaddiscriminated unions, and overridesort_keyif it needs ordering within its group.BaseExecutor.run_workloadand tostate_class_for_key.supported_workload_typeson supporting executors and handle it in_process_workloads.{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.Important
🛠️ Maintainer triage note for @anishgirianish · by
@potiuk· 2026-07-08 15:51 UTCSome review feedback from
@eladkalis waiting on you (2 unresolved threads):The ball is in your court — you've been assigned to this PR. Reply or push a fix in each thread, then mark them resolved. See the Pull Request quality criteria.
Automated triage — may be imperfect; a maintainer takes the next look.