Skip to contentSkip to conversation

command: Ensure that failure cases call finishAsyncComand

PATCH New Richard Purdie 1 participant 1 message Jan 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 lib/bb/command.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/command.py +2 -2
index 2b25ce5385..5d321cf9fa 100644
@@ -118,7 +118,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)
@@ -130,7 +130,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:
Signature · 1 line
2.37.2