From e7e1115ce6e7d17219685dd1d568faa7c062d16c Mon Sep 17 00:00:00 2001 From: "Christopher P. Anderson" <48180628+topherinternational@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:19:45 +0200 Subject: [PATCH] Serve logs from scheduler if any executor is LocalExecutor --- airflow-core/src/airflow/cli/commands/scheduler_command.py | 7 +++++-- .../tests/unit/cli/commands/test_scheduler_command.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/airflow-core/src/airflow/cli/commands/scheduler_command.py b/airflow-core/src/airflow/cli/commands/scheduler_command.py index e40592d4e3c51..2217717e50e56 100644 --- a/airflow-core/src/airflow/cli/commands/scheduler_command.py +++ b/airflow-core/src/airflow/cli/commands/scheduler_command.py @@ -79,8 +79,11 @@ def _serve_logs(skip_serve_logs: bool = False): sub_proc = None if skip_serve_logs is False: - executor_class, _ = ExecutorLoader.import_default_executor_cls() - if executor_class.serve_logs: + executor_classes = [ + ExecutorLoader.import_executor_cls(executor_name)[0] + for executor_name in (ExecutorLoader.get_executor_names()) + ] + if any(executor_class.serve_logs for executor_class in executor_classes): sub_proc = Process(target=serve_logs) sub_proc.start() try: diff --git a/airflow-core/tests/unit/cli/commands/test_scheduler_command.py b/airflow-core/tests/unit/cli/commands/test_scheduler_command.py index 2c9e995efabcc..1089edc12e89f 100644 --- a/airflow-core/tests/unit/cli/commands/test_scheduler_command.py +++ b/airflow-core/tests/unit/cli/commands/test_scheduler_command.py @@ -44,6 +44,8 @@ def setup_class(cls): ("CeleryExecutor", False), ("LocalExecutor", True), ("KubernetesExecutor", False), + ("LocalExecutor,KubernetesExecutor", True), + ("KubernetesExecutor,LocalExecutor", True), ], ) @mock.patch("airflow.cli.commands.scheduler_command.SchedulerJobRunner")