From 82e77db0cec6d380766e510b9b8fdd95e2b889d0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 2 Jan 2023 16:21:22 +0000 Subject: bitbake: command: Ensure that failure cases call finishAsyncComand There are a couple of failure cases that runCommands needs to better handle, ensuring finishAsyncCommand is called. This doesn't matter if the server is about to shut down but for memory resident bitbake and with threading enabled, correctness is more important this could could in theory lead to problems with the recent code changes. By using the idleFinish class, it ensures the current async command is terminated correctly and the various state pieces around commands finishing are called. This also makes the code more uniform matching the other exception handling code. (Bitbake rev: 367a83ed46c7fbcdd06579b6cc3a6e48a89ca7fb) Signed-off-by: Richard Purdie --- bitbake/lib/bb/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 0706b89271..e6fd4fbd9e 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -117,7 +117,7 @@ class Command: # updateCache will trigger a shutdown of the parser # and then raise BBHandledException triggering an exit self.cooker.updateCache() - return False + return bb.server.process.idleFinish("Cooker in error state") if self.currentAsyncCommand is not None: (command, options) = self.currentAsyncCommand commandmethod = getattr(CommandsAsync, command) @@ -129,7 +129,7 @@ class Command: commandmethod(self.cmds_async, self, options) return False else: - return False + return bb.server.process.idleFinish("Nothing to do, no async command?") except KeyboardInterrupt as exc: return bb.server.process.idleFinish("Interrupted") except SystemExit as exc: -- cgit v1.2.3-54-g00ecf