Unify executor workload queues#63491
Conversation
85bfce8 to
1ce0748
Compare
ferruzzi
left a comment
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.
aee94fb to
8997ee4
Compare
11ee7ef to
249b014
Compare
| @mock.patch("airflow.providers.celery.executors.celery_executor.CeleryExecutor.trigger_tasks") | ||
| @mock.patch( | ||
| "airflow.providers.celery.executors.celery_executor.CeleryExecutor." | ||
| + ("trigger_workloads" if AIRFLOW_V_3_2_PLUS else "trigger_tasks") |
There was a problem hiding this comment.
Note: AIRFLOW_V_3_2_PLUS might need to be adjusted if this change does not make it into 3.2.0
There was a problem hiding this comment.
Yeah, solid point. At this point we should assume 3.3 I think. Pretty sure the 3.2 beta is already cut and we're not likely to get this in there.
Blockers resolved, convinced me to un-block. Can make a second pass review if needed.
249b014 to
c108d08
Compare
|
@anishgirianish This PR has a few issues that need to be addressed before it can be reviewed — please see our Pull Request quality criteria. Issues found:
What to do next:
There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack. |
07187dc to
b718b12
Compare
3f7e866 to
3c89eeb
Compare
eae4e00 to
c8a4439
Compare
This reverts commit 1eb3da9.
c8a4439 to
84c79cb
Compare
Was generative AI tooling used to co-author this PR?
Summary
Refactors executor workload queue management for extensibility. No behavioral change , scheduling order, slot accounting, and all provider executors work identically to before.
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 simple primitives:
The base class queue_workload is now generic: validate the type, store by key. Four provider executors (K8s, ECS, Batch, Lambda) no longer need their own queue_workload overrides. trigger_tasks becomes trigger_workloads since it handles all workload types now.
Adding a new workload type after this refactor
No changes needed in BaseExecutor itself.
{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.