summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-26 18:21:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-30 13:05:03 +0100
commitaf5c7cf95f0adde15a8785ac7956841d7ac1ebce (patch)
treeddf16bfff0f08c003253d63225ac07593ce098c1 /bitbake
parent99f9b9b439d483f0d120b7590eb8b5e7f78b91e3 (diff)
downloadpoky-af5c7cf95f0adde15a8785ac7956841d7ac1ebce.tar.gz
bitbake: cooker: Fix main loop starvation when parsing
When parsing, the parser isn't servicing the main loop so a Ctrl+C in the UI won't be seen on the cooker/server side. Fix this by returning when queue timeouts occur. This helps where there is a hung or slow parsing thread. (Bitbake rev: a2cde38311a51112dca5e7bb4e7feaf4e6a281b3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index c4d720a6b6..fb71a968f2 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -2249,7 +2249,7 @@ class CookerParser(object):
2249 result = self.result_queue.get(timeout=0.25) 2249 result = self.result_queue.get(timeout=0.25)
2250 except queue.Empty: 2250 except queue.Empty:
2251 empty = True 2251 empty = True
2252 pass 2252 yield None, None, None
2253 else: 2253 else:
2254 empty = False 2254 empty = False
2255 yield result 2255 yield result
@@ -2266,6 +2266,10 @@ class CookerParser(object):
2266 if isinstance(result, BaseException): 2266 if isinstance(result, BaseException):
2267 # Turn exceptions back into exceptions 2267 # Turn exceptions back into exceptions
2268 raise result 2268 raise result
2269 if parsed is None:
2270 # Timeout, loop back through the main loop
2271 return True
2272
2269 except StopIteration: 2273 except StopIteration:
2270 self.shutdown() 2274 self.shutdown()
2271 return False 2275 return False