potiuk commented on code in PR #69597:
URL: https://github.com/apache/airflow/pull/69597#discussion_r3770430639


##########
providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py:
##########
@@ -240,7 +254,10 @@ def execute_workload(input: str) -> None:
     log.info("[%s] Executing workload in Celery: %s", celery_task_id, workload)
 
     try:
-        BaseExecutor.run_workload(workload)
+        BaseExecutor.run_workload(
+            workload,
+            subprocess_logs_to_stdout=_celery_task_logs_to_stdout_override(),

Review Comment:
   Passing `None` here only means "fall back to `[logging] 
task_logs_to_stdout`" on Airflow 3.4+. On 3.3 — which this provider still 
supports — `run_workload()` is `subprocess_logs_to_stdout: bool = False`, so 
`None` is just falsy and the global key is never consulted. Meanwhile the 
pre-3.3 branch below *does* resolve it, so the global setting works on 3.0–3.2, 
silently does nothing on 3.3, and works again on 3.4.
   
   Resolving it here, the same way `_execute_workload_pre_3_3` does, makes 
every supported version behave identically:
   
   ```suggestion
           subprocess_logs_to_stdout = _celery_task_logs_to_stdout_override()
           if subprocess_logs_to_stdout is None:
               subprocess_logs_to_stdout = conf.getboolean("logging", 
"task_logs_to_stdout", fallback=False)
           BaseExecutor.run_workload(
               workload,
               subprocess_logs_to_stdout=subprocess_logs_to_stdout,
           )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to