diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 23:27:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 22:05:10 +0100 |
commit | 29f6ade68fb2b506a23a7eb3a00cdcffa291b362 (patch) | |
tree | 7746475e413d470437035ba434eba64c282d986e /lib/bb | |
parent | 473deeb0fc6065693e1fcfcbb8b79753103db537 (diff) | |
download | bitbake-29f6ade68fb2b506a23a7eb3a00cdcffa291b362.tar.gz |
server/process: Fix missing log messages issue
Currently if the server dies, its possible that log messages are never
displayed which is particularly problematic if one of those messages
is the exception and backtrace the server died with.
Rather than having the event queue exit as soon as the server disappears,
we should pop events from the queue until its empty before exiting.
This patch tweaks that code so that even if the server is dead and we're
going to exit, we return any events left in the pipe. This makes
debugging certain failures much easier.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/server/process.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index a3078a873..cc58c720a 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -222,11 +222,10 @@ class ProcessEventQueue(multiprocessing.queues.Queue): def waitEvent(self, timeout): if self.exit: - sys.exit(1) + return self.getEvent() try: if not self.server.is_alive(): - self.setexit() - return None + return self.getEvent() return self.get(True, timeout) except Empty: return None @@ -235,9 +234,10 @@ class ProcessEventQueue(multiprocessing.queues.Queue): try: if not self.server.is_alive(): self.setexit() - return None return self.get(False) except Empty: + if self.exit: + sys.exit(1) return None |