diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-26 18:21:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-30 13:04:07 +0100 |
commit | a2cde38311a51112dca5e7bb4e7feaf4e6a281b3 (patch) | |
tree | df9a6516fe17d70be4f9ccc1f43d5d225688e7be | |
parent | ae89e23696de2f27c00ae00922933395171de5d5 (diff) | |
download | bitbake-a2cde38311a51112dca5e7bb4e7feaf4e6a281b3.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/cooker.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index c4d720a6b..fb71a968f 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -2249,7 +2249,7 @@ class CookerParser(object): result = self.result_queue.get(timeout=0.25) except queue.Empty: empty = True - pass + yield None, None, None else: empty = False yield result @@ -2266,6 +2266,10 @@ class CookerParser(object): if isinstance(result, BaseException): # Turn exceptions back into exceptions raise result + if parsed is None: + # Timeout, loop back through the main loop + return True + except StopIteration: self.shutdown() return False |