[poky] [PATCH 15/31] cooker.py: terminate the Parser processes
Scott Garman
scott.a.garman at intel.com
Tue Jun 12 13:41:05 PDT 2012
From: Kang Kai <kai.kang at windriver.com>
[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.
(Bitbake rev: bebef58b21bdff7a3ee1fa2449b7df19144f26fd)
Signed-off-by: Kang Kai <kai.kang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
bitbake/lib/bb/cooker.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index dea0aad..4a4dc38 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/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:
@@ -1608,10 +1608,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)
--
1.7.9.5
More information about the poky
mailing list