This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 372b8ed40a2 Serve logs from scheduler if any executor is LocalExecutor 
(#71283)
372b8ed40a2 is described below

commit 372b8ed40a29534f4c445870c99b56e36c1d7d55
Author: Christopher Anderson 
<[email protected]>
AuthorDate: Tue Aug 18 18:27:45 2026 +0200

    Serve logs from scheduler if any executor is LocalExecutor (#71283)
---
 airflow-core/src/airflow/cli/commands/scheduler_command.py     | 7 +++++--
 airflow-core/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 e40592d4e3c..2217717e50e 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 2c9e995efab..1089edc12e8 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 @@ class TestSchedulerCommand:
             ("CeleryExecutor", False),
             ("LocalExecutor", True),
             ("KubernetesExecutor", False),
+            ("LocalExecutor,KubernetesExecutor", True),
+            ("KubernetesExecutor,LocalExecutor", True),
         ],
     )
     @mock.patch("airflow.cli.commands.scheduler_command.SchedulerJobRunner")

Reply via email to