Fix excessive buffering of worker stdout/stderr. (#4094)

* Start workers with 'python -u' to prevent buffering of prints.

* Set sys.stdout and sys.stderr.

* Add comment.
This commit is contained in:
Robert Nishihara
2019-02-19 20:20:47 -08:00
committed by Philipp Moritz
parent 5fe7b1c618
commit e7651b1117
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -223,7 +223,7 @@ class Node(object):
suffix=".out", prefix=name, directory_name=self._logs_dir)
log_stderr = self._make_inc_temp(
suffix=".err", prefix=name, directory_name=self._logs_dir)
# Line-buffer the output (mode 1)
# Line-buffer the output (mode 1).
log_stdout_file = open(log_stdout, "a", buffering=1)
log_stderr_file = open(log_stderr, "a", buffering=1)
return log_stdout_file, log_stderr_file