aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-22 10:24:46 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-24 10:08:02 +0000
commit6e746ccf8977a78f1565c6b2fe65aaede260e1bb (patch)
tree3e722b3a516939257141f8fecb3c8c7d7122fcd3 /lib/bb
parent573968cb3e04567559d400a753f0be8d5a0da0b8 (diff)
downloadbitbake-6e746ccf8977a78f1565c6b2fe65aaede260e1bb.tar.gz
cooker: Handle parse threads disappearing to avoid hangs
If one of the parse threads disappears during parsing for some reason, bitbake currently hangs. Avoid this (and zombie threads hanging around) by joining() threads which have exited. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc86a533d951d13643ce446533370da804782afc) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r--lib/bb/cooker.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index b041d2a06..f12f4caa0 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -2036,6 +2036,7 @@ class Parser(multiprocessing.Process):
result = pending.pop()
else:
try:
+ time.sleep(0.25)
job = self.jobs.pop()
except IndexError:
self.results.close()
@@ -2214,7 +2215,7 @@ class CookerParser(object):
yield not cached, mc, infos
def parse_generator(self):
- while True:
+ while self.processes:
if self.parsed >= self.toparse:
break
@@ -2228,6 +2229,14 @@ class CookerParser(object):
raise value
else:
yield result
+ for process in self.processes.copy():
+ if not process.is_alive():
+ process.join()
+ self.processes.remove(process)
+
+ if not (self.parsed >= self.toparse):
+ raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? Exiting.", None)
+
def parse_next(self):
result = []