aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-28 15:33:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-28 15:54:02 +0100
commit930d077637928213e13a07c78fee3bf7a8c37ebf (patch)
tree33ca63cbde07cd2e0452cd64a4f5b5cb6d3be5a6
parentf79187f4ebfad7969be47b429995e7f7a3e33c1e (diff)
downloadbitbake-contrib-930d077637928213e13a07c78fee3bf7a8c37ebf.tar.gz
process: Allow BBUIEventQueue to exit cleanly
Currently the monitoring thread exits with some error code or runs indefinitely. Allow closure of the pipe its monitoring to have the thread exit cleanly/silently. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/server/process.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 8a7c43160..3d9077fd0 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -499,9 +499,14 @@ class BBUIEventQueue:
def startCallbackHandler(self):
bb.utils.set_process_name("UIEventQueue")
while True:
- self.reader.wait()
- event = self.reader.get()
- self.queue_event(event)
+ try:
+ self.reader.wait()
+ event = self.reader.get()
+ self.queue_event(event)
+ except EOFError:
+ # Easiest way to exit is to close the file descriptor to cause an exit
+ break
+ self.reader.close()
class ConnectionReader(object):