Serve logs from scheduler if any executor is LocalExecutor - #71283
Open
topherinternational wants to merge 1 commit into
Open
Serve logs from scheduler if any executor is LocalExecutor#71283topherinternational wants to merge 1 commit into
topherinternational wants to merge 1 commit into
Conversation
topherinternational
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
August 7, 2026 14:00
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.
This change causes the scheduler to start the local log server if the
LocalExecutoris anywhere in the list of configured executors; previously, scheduler would start the log server only ifLocalExecutorwas the default (first) executor.In my org, we set up multiple executors on Airflow 2 with the
core.executorconfig set toKubernetesExecutor,LocalExecutor. We put theKubernetesExecutorfirst as a fail-safe - in the event a task runs without specifying an executor, we want it to run in an isolated pod so it doesn't threaten resources on the scheduler or its locally-running tasks.After we upgraded to Airflow 3, we noticed:
Connection refusederror trying to connect to the scheduler on port 8793I examined the code and found that
scheduler_commandlaunches the log server only ifLocalExecutoris the default executor (i.e., the first executor listed in the configuration).This PR solves the issue by examining all configured executor types instead of only the default when deciding whether to launch the log server.
I've added two test cases to the existing parameterized
TestSchedulerCommand.test_serve_logs_on_scheduler()method:"LocalExecutor,KubernetesExecutor"passes before and after this fix, showing that the log server is launched when the local executor is the default in a multiple-executor setup"KubernetesExecutor,LocalExecutor"fails before this fix and passes after it, showing that the log server is launched when the local executor is non-default in a multiple-executor setupWas generative AI tooling used to co-author this PR?