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>
This commit is contained in:
Kang Kai 2012-05-23 17:40:19 +08:00 committed by Richard Purdie
parent fcd8021409
commit f28209d9d3
1 changed files with 6 additions and 3 deletions

View File

@ -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)