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

potiuk pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-3-test by this push:
     new 65563f595b9 [v3-3-test] Fix triggerer CrashLoopBackOff when json_logs 
is enabled (#68584) (#70669)
65563f595b9 is described below

commit 65563f595b926dfdc5318a3cf7e86aaac71e2fc2
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jul 30 21:26:47 2026 +0200

    [v3-3-test] Fix triggerer CrashLoopBackOff when json_logs is enabled 
(#68584) (#70669)
---
 .../src/airflow/jobs/triggerer_job_runner.py        |  2 +-
 airflow-core/tests/unit/jobs/test_triggerer_job.py  | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/jobs/triggerer_job_runner.py 
b/airflow-core/src/airflow/jobs/triggerer_job_runner.py
index eccd9d2fc04..b8788c05e45 100644
--- a/airflow-core/src/airflow/jobs/triggerer_job_runner.py
+++ b/airflow-core/src/airflow/jobs/triggerer_job_runner.py
@@ -997,7 +997,7 @@ class TriggerRunnerSupervisor(WatchedSubprocess):
 
         from airflow.sdk.log import configure_logging
 
-        configure_logging()
+        configure_logging(json_output=conf.getboolean("logging", "json_logs", 
fallback=False))
 
         fallback_log = structlog.get_logger(logger_name=__name__)
 
diff --git a/airflow-core/tests/unit/jobs/test_triggerer_job.py 
b/airflow-core/tests/unit/jobs/test_triggerer_job.py
index ff3dde7df59..91e62cf4113 100644
--- a/airflow-core/tests/unit/jobs/test_triggerer_job.py
+++ b/airflow-core/tests/unit/jobs/test_triggerer_job.py
@@ -362,6 +362,27 @@ def test_run_invokes_seams_in_order(supervisor_builder, 
mocker):
     assert events == ["enter", "tick-1", "tick-2", "tick-3", "exit"]
 
 
[email protected]("json_logs", [True, False])
+def 
test_process_log_messages_configures_logging_matching_json_logs(supervisor_builder,
 mocker, json_logs):
+    """_process_log_messages_from_subprocess() must reconfigure logging using 
the
+    configured ``logging.json_logs`` value rather than the default
+    ``json_output=False``.
+    This generator reconfigures structlog globally when first primed. Failing 
to
+    propagate the configured JSON logging mode can leave the triggerer with an
+    inconsistent logging configuration and break subprocess log forwarding.
+    """
+    supervisor = supervisor_builder()
+
+    configure_logging = mocker.patch("airflow.sdk.log.configure_logging")
+    mocker.patch("airflow.sdk.log.logging_processors")
+
+    with conf_vars({("logging", "json_logs"): str(json_logs)}):
+        gen = supervisor._process_log_messages_from_subprocess()
+        next(gen)  # prime the generator -- this is what calls 
configure_logging()
+
+    configure_logging.assert_called_once_with(json_output=json_logs)
+
+
 def test_client_delegates_to_make_client_and_caches_result(supervisor_builder, 
mocker):
     """``supervisor.client`` delegates to ``make_client`` (the 
subclass-override hook)
     and caches the result across accesses."""

Reply via email to