diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-08 13:24:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-08 22:01:19 +0000 |
commit | bf411441f5368284ae6a6ac9707c689f48973083 (patch) | |
tree | 0d44e70c6680ed5e3a5883678b8e81ca35a0aae9 /bitbake/lib | |
parent | d8e5d5fc16077a7a66f00842a33c23905b5cde8b (diff) | |
download | poky-bf411441f5368284ae6a6ac9707c689f48973083.tar.gz |
bitbake: 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.
(Bitbake rev: dc86a533d951d13643ce446533370da804782afc)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2b92744998..f0cea2b256 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -2040,6 +2040,7 @@ class Parser(multiprocessing.Process): | |||
2040 | result = pending.pop() | 2040 | result = pending.pop() |
2041 | else: | 2041 | else: |
2042 | try: | 2042 | try: |
2043 | time.sleep(0.25) | ||
2043 | job = self.jobs.pop() | 2044 | job = self.jobs.pop() |
2044 | except IndexError: | 2045 | except IndexError: |
2045 | self.results.close() | 2046 | self.results.close() |
@@ -2218,7 +2219,7 @@ class CookerParser(object): | |||
2218 | yield not cached, mc, infos | 2219 | yield not cached, mc, infos |
2219 | 2220 | ||
2220 | def parse_generator(self): | 2221 | def parse_generator(self): |
2221 | while True: | 2222 | while self.processes: |
2222 | if self.parsed >= self.toparse: | 2223 | if self.parsed >= self.toparse: |
2223 | break | 2224 | break |
2224 | 2225 | ||
@@ -2232,6 +2233,14 @@ class CookerParser(object): | |||
2232 | raise value | 2233 | raise value |
2233 | else: | 2234 | else: |
2234 | yield result | 2235 | yield result |
2236 | for process in self.processes.copy(): | ||
2237 | if not process.is_alive(): | ||
2238 | process.join() | ||
2239 | self.processes.remove(process) | ||
2240 | |||
2241 | if not (self.parsed >= self.toparse): | ||
2242 | raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? Exiting.", None) | ||
2243 | |||
2235 | 2244 | ||
2236 | def parse_next(self): | 2245 | def parse_next(self): |
2237 | result = [] | 2246 | result = [] |