1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

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>
This commit is contained in:
Richard Purdie
2022-03-26 18:21:07 +00:00
parent 99f9b9b439
commit af5c7cf95f
+5 -1
View File
@@ -2249,7 +2249,7 @@ class CookerParser(object):
result = self.result_queue.get(timeout=0.25) result = self.result_queue.get(timeout=0.25)
except queue.Empty: except queue.Empty:
empty = True empty = True
pass yield None, None, None
else: else:
empty = False empty = False
yield result yield result
@@ -2266,6 +2266,10 @@ class CookerParser(object):
if isinstance(result, BaseException): if isinstance(result, BaseException):
# Turn exceptions back into exceptions # Turn exceptions back into exceptions
raise result raise result
if parsed is None:
# Timeout, loop back through the main loop
return True
except StopIteration: except StopIteration:
self.shutdown() self.shutdown()
return False return False