summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKang Kai <kai.kang@windriver.com>2012-05-23 17:40:19 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-25 11:39:26 +0100
commitbebef58b21bdff7a3ee1fa2449b7df19144f26fd (patch)
tree66638068dc33231fe0e1adb896e6a5c6433b9dc9
parent8b61b9584a8b00378f9fd8f165dbd65dcfd3c14e (diff)
downloadbitbake-bebef58b21bdff7a3ee1fa2449b7df19144f26fd.tar.gz
cooker.py: terminate the Parser processes
[Yocto 2142] Force to exit HOB when hob is parsing recipes, the bitbake doesn't stop. It hangs on function BitBakeServerConnection::terminate in file server/process.py: else: self.procserver.join() It is waiting for the children process quit. In stage of parse recipes BBCooker spawns Parser processes as many as cpu numbers. When quit the Parser processes they make their internal Queue to call cancel_join_thread() to avoid block but don't work at this time. So force to terminate the Parser processes. Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index bafd832a6..d1de7572d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1175,7 +1175,7 @@ class BBCooker:
return
if self.state in (state.shutdown, state.stop):
- self.parser.shutdown(clean=False)
+ self.parser.shutdown(clean=False, force = True)
sys.exit(1)
if self.state != state.parsing:
@@ -1609,10 +1609,13 @@ class CookerParser(object):
self.parser_quit.put(None)
self.jobs.cancel_join_thread()
- sys.exit(1)
for process in self.processes:
- process.join()
+ if force:
+ process.join(.1)
+ process.terminate()
+ else:
+ process.join()
self.feeder.join()
sync = threading.Thread(target=self.bb_cache.sync)