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:33 +0100
commitf28209d9d3c67203a2c7a2b25cacfe31643d1bfa (patch)
treed8ed8a17d68738d006fd43c0d1c759f9c59224d4
parentfcd80214091e3cf41af184e24081d71981d48a8c (diff)
downloadpoky-f28209d9d3c67203a2c7a2b25cacfe31643d1bfa.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. (Bitbake rev: bebef58b21bdff7a3ee1fa2449b7df19144f26fd) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index bafd832a67..d1de7572d7 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1175,7 +1175,7 @@ class BBCooker:
1175 return 1175 return
1176 1176
1177 if self.state in (state.shutdown, state.stop): 1177 if self.state in (state.shutdown, state.stop):
1178 self.parser.shutdown(clean=False) 1178 self.parser.shutdown(clean=False, force = True)
1179 sys.exit(1) 1179 sys.exit(1)
1180 1180
1181 if self.state != state.parsing: 1181 if self.state != state.parsing:
@@ -1609,10 +1609,13 @@ class CookerParser(object):
1609 self.parser_quit.put(None) 1609 self.parser_quit.put(None)
1610 1610
1611 self.jobs.cancel_join_thread() 1611 self.jobs.cancel_join_thread()
1612 sys.exit(1)
1613 1612
1614 for process in self.processes: 1613 for process in self.processes:
1615 process.join() 1614 if force:
1615 process.join(.1)
1616 process.terminate()
1617 else:
1618 process.join()
1616 self.feeder.join() 1619 self.feeder.join()
1617 1620
1618 sync = threading.Thread(target=self.bb_cache.sync) 1621 sync = threading.Thread(target=self.bb_cache.sync)