From: Robert Yang Date: Wed, 7 Aug 2019 09:50:48 +0000 (+0800) Subject: bitbake: cooker: Cleanup the queue before call process.join() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=016b91b334c17cf542711a90fcde8d7278867eb0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: cooker: Cleanup the queue before call process.join() 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 Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 6e1d59bb3a6..ec1b35d7242 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -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)