]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: cooker: Cleanup the queue before call process.join()
authorRobert Yang <liezhi.yang@windriver.com>
Wed, 7 Aug 2019 09:50:48 +0000 (17:50 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Aug 2019 09:22:36 +0000 (10:22 +0100)
Fixed:
$ rm -fr tmp-glibc/cache/default-glibc/qemux86/x86_64/bb_cache.dat* ; bitbake -p
Press *one* Ctrl-C when the parsing process is at about 50%, then the processes
are not exited:

Keyboard Interrupt, closing down...

Timeout while waiting for a reply from the bitbake server

It hangs at process.join(), according to:

https://docs.python.org/3.7/library/multiprocessing.html

Cleanup the queue before call process.join() can fix the problem.

(Bitbake rev: 3eddfadd19b2ce4c061861abf0c340e3825b41ff)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/cooker.py

index 6e1d59bb3a628f4d434fce3d9501ba0092277755..ec1b35d724236045df6eb40288b00ac7478c085c 100644 (file)
@@ -2077,6 +2077,14 @@ class CookerParser(object):
             for process in self.processes:
                 self.parser_quit.put(None)
 
+        # Cleanup the queue before call process.join(), otherwise there might be
+        # deadlocks.
+        while True:
+            try:
+               self.result_queue.get(timeout=0.25)
+            except queue.Empty:
+                break
+
         for process in self.processes:
             if force:
                 process.join(.1)