Skip to content

Run team tasks on the team executor when named by class or path - #75362

Merged
o-nikolas merged 2 commits into
apache:mainfrom
aws-mwaa:onikolas/scheduler-team-executor-first
Oct 22, 2026
Merged

o-nikolas merged 2 commits into
apache:mainfrom
aws-mwaa:onikolas/scheduler-team-executor-first

Conversation

@o-nikolas

Copy link
Copy Markdown
Contributor

With multi-team enabled, a team task that names its executor by class name or module path (e.g. executor="CeleryExecutor") is documented to run on its team's executor of that class. Only the global alias should reach the global executor ("Aliasing Executors Across Teams" in the multi-team docs).

The scheduler took the first matching executor instead, and global executors are always listed before team ones. So these tasks silently ran on the shared global executor, outside the team boundary, and anything resolving executors the documented way (such as reading live task logs) looked in the wrong place.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {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.

@seanghaeli

Copy link
Copy Markdown
Contributor

Helper method ExecutorLoader.resolve_executor_name from #75255 can be re-used here (when it merges), so the implementations don't drift

With multi-team enabled, a team task that names its executor by class
name or module path (e.g. executor="CeleryExecutor") is documented to
run on its team's executor of that class. Only the global alias should
reach the global executor ("Aliasing Executors Across Teams" in the
multi-team docs).

The scheduler took the first matching executor instead, and global
executors are always listed before team ones. So these tasks silently
ran on the shared global executor, outside the team boundary, and
anything resolving executors the documented way (such as reading live
task logs) looked in the wrong place.
The scheduler and task log reading each had their own copy of the
rule for picking a task's executor. The copies already drifted apart
once: the scheduler picked a global executor where log reading picked
the team's. Sharing ExecutorLoader.resolve_executor_name means a
task's logs are always read from the executor it ran on.

Scheduler test mocks now put an executor's team on its name too, as
the executor loader does, because the helper reads the team from the
name.
@o-nikolas
o-nikolas force-pushed the onikolas/scheduler-team-executor-first branch from 0f97bdb to e66b9fe Compare October 22, 2026 15:53
@o-nikolas o-nikolas added this to the Airflow 3.4.0 milestone Oct 22, 2026
@o-nikolas
o-nikolas merged commit 0abd161 into apache:main Oct 22, 2026
66 checks passed
@o-nikolas
o-nikolas deleted the onikolas/scheduler-team-executor-first branch October 22, 2026 23:21
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 23, 2026
…r path (#75362) (#75436)

With multi-team enabled, a team task that names its executor by class
name or module path (e.g. executor="CeleryExecutor") is documented to
run on its team's executor of that class. Only the global alias should
reach the global executor ("Aliasing Executors Across Teams" in the
multi-team docs).

The scheduler took the first matching executor instead, and global
executors are always listed before team ones. So these tasks silently
ran on the shared global executor, outside the team boundary, and
anything resolving executors the documented way (such as reading live
task logs) looked in the wrong place.
(cherry picked from commit 0abd161)

Co-authored-by: Niko Oliveira <onikolas@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants