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/06/22 12:36:57 UTC

[GitHub] [airflow] ashb commented on a change in pull request #15743: Redirect forked process output to logger

ashb commented on a change in pull request #15743:
URL: https://github.com/apache/airflow/pull/15743#discussion_r656174331



##########
File path: airflow/task/task_runner/standard_task_runner.py
##########
@@ -82,13 +86,21 @@ def _start_by_fork(self):  # pylint: disable=inconsistent-return-statements
             setproctitle(proc_title.format(args))
 
             try:
+                os.close(rpipe)
+                sys.stdout.flush()
+                # replace fds for the stdout/stderr with the newly created pipe
+                os.dup2(wpipe, 1)
+                os.dup2(wpipe, 2)

Review comment:
       ```suggestion
                   os.dup2(wpipe, sys.__stdout__.fileno())
                   os.dup2(wpipe, sys.__stderr__.filenow())
   ```




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

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