summaryrefslogtreecommitdiffstats
path: root/bitbake
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-06-14 11:27:05 +0100
commit4c4924ad1b7a169ea35446ec9fe6fb33eb452014 (patch)
treeca1ffe11ae93a914b0e116d1a2091570ff7fec64 /bitbake
parent9e6d1101b46089c1c6749f985ecdc1cb0ef87ac8 (diff)
downloadpoky-4c4924ad1b7a169ea35446ec9fe6fb33eb452014.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>
Diffstat (limited to 'bitbake')
-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 dea0aadbee..4a4dc385a3 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:
@@ -1608,10 +1608,13 @@ class CookerParser(object):
1608 self.parser_quit.put(None) 1608 self.parser_quit.put(None)
1609 1609
1610 self.jobs.cancel_join_thread() 1610 self.jobs.cancel_join_thread()
1611 sys.exit(1)
1612 1611
1613 for process in self.processes: 1612 for process in self.processes:
1614 process.join() 1613 if force:
1614 process.join(.1)
1615 process.terminate()
1616 else:
1617 process.join()
1615 self.feeder.join() 1618 self.feeder.join()
1616 1619
1617 sync = threading.Thread(target=self.bb_cache.sync) 1620 sync = threading.Thread(target=self.bb_cache.sync)