github-actions[bot] opened a new pull request, #70669:
URL: https://github.com/apache/airflow/pull/70669

   * Fix triggerer CrashLoopBackOff when json_logs is enabled
   
   TriggerRunnerSupervisor._process_log_messages_from_subprocess primes itself
   by calling airflow.sdk.log.configure_logging() with no arguments. json_output
   defaults to False, so this reconfigures structlog globally and installs the
   text WriteLogger factory -- overwriting the bytes BytesLogger factory that
   startup set up from json_logs=True.
   
   The stdout/stderr forwarders (_create_log_forwarder -> forward_to_log) were
   already wrapped with the JSON (bytes) processor chain but bind their 
underlying
   logger lazily. As soon as a trigger subprocess writes to stdout/stderr -- for
   example an import-time warning from a provider trigger that pulls in a heavy
   client (kubernetes, boto3) -- the lazy bind resolves against the now-text
   factory and WriteLogger.msg does `message + "\n"` on bytes from the JSON
   renderer, raising `TypeError: can't concat str to bytes` and crash-looping 
the
   triggerer.
   
   Pass json_output from the logging.json_logs config so the global structlog
   factory stays consistent with the rest of the process.
   
   * Add newsfragment
   
   * Refactor docstring for test_process_log_messages_configures_logging
   
   Updated the docstring to clarify the behavior of 
`_process_log_messages_from_subprocess()` regarding JSON logging configuration.
   
   * Delete airflow-core/newsfragments/68584.bugfix.rst
   
   * Remove comments about logging configuration
   
   Removed comments explaining the configure_logging function's behavior with 
json_logs setting.
   (cherry picked from commit ebe6c58d42e6b6799a61b98312f0e38671204de1)
   
   Co-authored-by: safaehar <[email protected]>


-- 
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