]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: process: Allow BBUIEventQueue to exit cleanly
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 28 Jul 2017 14:33:32 +0000 (15:33 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 30 Jul 2017 07:43:36 +0000 (08:43 +0100)
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.

(Bitbake rev: 930d077637928213e13a07c78fee3bf7a8c37ebf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/server/process.py

index 8a7c43160a1689313f661aa68f341e5f12a85465..3d9077fd07c4c24bf239b52d30a5c804818a928a 100644 (file)
@@ -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):