You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/18 09:36:24 UTC

[GitHub] [airflow] potiuk commented on issue #14813: Forked processes aren't logged by tasks using the Python Operator

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


   Agree it's not easy, but I think it's just a matter of careful implementation (and making some compromises), rather than using yet another dependency.
   
   Isn't that the case that stderr is also sent to stdout in SubprocessHook @hterik ? I think someone (not me :) ) made a decision that in this case we do not care about the stderr/stdout difference (`see stderr=STDOUT`) line:
   
   ```
               self.sub_process = Popen(
                   command,
                   stdout=PIPE,
                   stderr=STDOUT,
                   cwd=cwd,
                   env=env if env or env == {} else os.environ,
                   preexec_fn=pre_exec,
               )
   
               self.log.info('Output:')
               line = ''
               for raw_line in iter(self.sub_process.stdout.readline, b''):
                   line = raw_line.decode(output_encoding).rstrip()
                   self.log.info("%s", line)
   ```


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