You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hterik (via GitHub)" <gi...@apache.org> on 2024/02/06 08:45:48 UTC

Re: [I] Forked processes aren't logged by tasks using the Python Operator [airflow]

hterik commented on issue #14813:
URL: https://github.com/apache/airflow/issues/14813#issuecomment-1929033747

   > You can instead write your own "run" function and send output to logger.getLogger("airflow.task").
   > 
   > I've written this one to meet my needs.
   > `...`
   
   
   This will deadlock if stderr produces enough output to fill the buffer. See warning under https://docs.python.org/3/library/subprocess.html#subprocess.Popen.stderr 
   This is why `POpen.communicate()` exists. For streaming output, the easiest is to merge the two streams into one using `stderr=subprocess.STDOUT`, then it is safe to `read()` stdout incrementally. 
   
   If you really care about streaming both streams individually, the solution becomes incredibly complex using `select` and other more low level primitives.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org