From 016b91b334c17cf542711a90fcde8d7278867eb0 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Wed, 7 Aug 2019 17:50:48 +0800 Subject: 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 --- bitbake/lib/bb/cooker.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 6e1d59bb3a..ec1b35d724 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) -- cgit v1.2.3-54-g00ecf