summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-04 15:54:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-05 18:01:37 +0100
commit74feaddda3b7cd5b3ab18d2f25bf5ef9581c9c47 (patch)
tree0e5d4c72d97ba4c0669aaf8394439778ea5ed33e /bitbake/lib/bb/event.py
parentb7e26bedc2952e4ac0edface4bd20be22d7708cd (diff)
downloadpoky-74feaddda3b7cd5b3ab18d2f25bf5ef9581c9c47.tar.gz
bitbake: server/process: Various server startup logging fixes
There were various problems in the server startup loggin: a) stdout/stderr were not being flushed before forking which could potentially duplicate output b) there were separate buffers for stdout/stderr leading to confusing logs where the entries could be reordered. This was particularly confusing due to the separator the logs use to idendify new messages c) an fd wasn't being closed during server startup meaning if the server failed to start, the closed fd wasn't detected as it was held open by the other reference d) If the pipe was detected as being closed, the code incorrectly retried server startup e) The event code would remap stdout/stderr without flushing them, leading to lose log messages (Bitbake rev: 0594faa0b52ce5dbd948d836d88617d38d9862d1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r--bitbake/lib/bb/event.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index c0ec605209..5b1b094a80 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -141,6 +141,9 @@ def print_ui_queue():
141 logger = logging.getLogger("BitBake") 141 logger = logging.getLogger("BitBake")
142 if not _uiready: 142 if not _uiready:
143 from bb.msg import BBLogFormatter 143 from bb.msg import BBLogFormatter
144 # Flush any existing buffered content
145 sys.stdout.flush()
146 sys.stderr.flush()
144 stdout = logging.StreamHandler(sys.stdout) 147 stdout = logging.StreamHandler(sys.stdout)
145 stderr = logging.StreamHandler(sys.stderr) 148 stderr = logging.StreamHandler(sys.stderr)
146 formatter = BBLogFormatter("%(levelname)s: %(message)s") 149 formatter = BBLogFormatter("%(levelname)s: %(message)s")