summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/command.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-02 16:21:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-02 17:32:57 +0000
commit82e77db0cec6d380766e510b9b8fdd95e2b889d0 (patch)
tree63f3e42144ae51fe9ee11ebbcac7c8aad3d53c02 /bitbake/lib/bb/command.py
parent59a06db5dc7b3c5dc2b5f79304b2d73e341f251c (diff)
downloadpoky-82e77db0cec6d380766e510b9b8fdd95e2b889d0.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r--bitbake/lib/bb/command.py4
1 files 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:
117 # updateCache will trigger a shutdown of the parser 117 # updateCache will trigger a shutdown of the parser
118 # and then raise BBHandledException triggering an exit 118 # and then raise BBHandledException triggering an exit
119 self.cooker.updateCache() 119 self.cooker.updateCache()
120 return False 120 return bb.server.process.idleFinish("Cooker in error state")
121 if self.currentAsyncCommand is not None: 121 if self.currentAsyncCommand is not None:
122 (command, options) = self.currentAsyncCommand 122 (command, options) = self.currentAsyncCommand
123 commandmethod = getattr(CommandsAsync, command) 123 commandmethod = getattr(CommandsAsync, command)
@@ -129,7 +129,7 @@ class Command:
129 commandmethod(self.cmds_async, self, options) 129 commandmethod(self.cmds_async, self, options)
130 return False 130 return False
131 else: 131 else:
132 return False 132 return bb.server.process.idleFinish("Nothing to do, no async command?")
133 except KeyboardInterrupt as exc: 133 except KeyboardInterrupt as exc:
134 return bb.server.process.idleFinish("Interrupted") 134 return bb.server.process.idleFinish("Interrupted")
135 except SystemExit as exc: 135 except SystemExit as exc: