summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/cooker.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index e88ad24cf6..938b999b4f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -2067,8 +2067,9 @@ class Parser(multiprocessing.Process):
2067 2067
2068 jobid = None 2068 jobid = None
2069 try: 2069 try:
2070 jobid = self.jobid_queue.get(True, 0.5) 2070 # Have to wait for all parsers to have forked
2071 except (ValueError, OSError): 2071 jobid = self.jobid_queue.get(True, 5)
2072 except (ValueError, OSError, queue.Empty):
2072 havejobs = False 2073 havejobs = False
2073 2074
2074 if jobid is not None: 2075 if jobid is not None:
@@ -2171,15 +2172,16 @@ class CookerParser(object):
2171 self.parser_quit = multiprocessing.Event() 2172 self.parser_quit = multiprocessing.Event()
2172 self.result_queue = multiprocessing.Queue() 2173 self.result_queue = multiprocessing.Queue()
2173 2174
2174 for jobid in range(len(self.willparse)): 2175 # Have to pass in willparse at fork time so all parsing processes have the unpickleable data
2175 self.toparse_queue.put(jobid) 2176 # then access it by index from the parse queue.
2176
2177 for i in range(0, self.num_processes): 2177 for i in range(0, self.num_processes):
2178 parser = Parser(self.willparse, self.toparse_queue, self.result_queue, self.parser_quit, self.cooker.configuration.profile) 2178 parser = Parser(self.willparse, self.toparse_queue, self.result_queue, self.parser_quit, self.cooker.configuration.profile)
2179 parser.start() 2179 parser.start()
2180 self.process_names.append(parser.name) 2180 self.process_names.append(parser.name)
2181 self.processes.append(parser) 2181 self.processes.append(parser)
2182 2182
2183 for jobid in range(len(self.willparse)):
2184 self.toparse_queue.put(jobid)
2183 self.toparse_queue.close() 2185 self.toparse_queue.close()
2184 2186
2185 self.results = itertools.chain(self.results, self.parse_generator()) 2187 self.results = itertools.chain(self.results, self.parse_generator())
@@ -2290,7 +2292,7 @@ class CookerParser(object):
2290 yield result 2292 yield result
2291 2293
2292 if not (self.parsed >= self.toparse): 2294 if not (self.parsed >= self.toparse):
2293 raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? Exiting.", None) 2295 raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? (%s %s of %s) Exiting." % (len(self.processes), self.parsed, self.toparse), None)
2294 2296
2295 2297
2296 def parse_next(self): 2298 def parse_next(self):