Repository navigation
Improve performance of task dequeuing - #61376
Merged
Merged
Conversation
steveahnahn
requested review from
XD-DENG,
amoghrajesh,
ashb,
bolkedebruin,
dheerajturaga,
hussein-awala,
kaxil,
o-nikolas and
pierrejeambrun
as code owners
February 3, 2026 05:12
shivaam
approved these changes
Feb 3, 2026
Contributor
|
Provider unit tests failed. |
o-nikolas
approved these changes
Feb 6, 2026
Contributor
Backport failed to create: v3-1-test. View the failure log Run details
You can attempt to backport this manually by running: cherry_picker fd4fd67 v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
choo121600
pushed a commit
to choo121600/airflow
that referenced
this pull request
Feb 22, 2026
* pop(0) to popleft() * revert with reverse list
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Mar 4, 2026
* pop(0) to popleft() * revert with reverse list
dominikhei
pushed a commit
to dominikhei/airflow
that referenced
this pull request
Mar 11, 2026
* pop(0) to popleft() * revert with reverse list
Ankurdeewan
pushed a commit
to Ankurdeewan/airflow
that referenced
this pull request
Mar 15, 2026
* pop(0) to popleft() * revert with reverse list
radhwene
pushed a commit
to radhwene/airflow
that referenced
this pull request
Mar 21, 2026
* pop(0) to popleft() * revert with reverse list
1 task done
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.
Summary
Replace
list.pop(0)withdeque.popleft()in three hot‑path task traversal/queueing loops to avoid O(n^2) behavior.list.pop(0)is O(n) due to element shifting; repeated in loops it becomes O(n^2).deque.popleft()is O(1) and preserves ordering.Changes
airflow-core/src/airflow/executors/base_executor.py: usedequeintrigger_tasks()airflow-core/src/airflow/serialization/definitions/taskgroup.py: usedequeiniter_tasks()task-sdk/src/airflow/sdk/definitions/taskgroup.py: usedequeiniter_tasks()