diff mbox series

[4/4] cooker: Fix exit handling issues

Message ID 20230111175058.1526619-4-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 4f73c2eb12ee074f3b7d4717380649f6ca8f3def
Headers show
Series [1/4] tinfoil: Don't wait for events indefinitely | expand

Commit Message

Richard Purdie Jan. 11, 2023, 5:50 p.m. UTC
The shutdown() call should definitely not be waiting for idle, since we
expect execution and events to continue even after setting either shutdown
state. This was causing the UI to appear to hang at Ctrl+C interrupts.

Also ensure that if we reset cooker, we stop any active parser processes
since these currently appear to be being left behind.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/cooker.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 5cb5c2a2b6..617d582acc 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1743,7 +1743,7 @@  class BBCooker:
         return
 
     def post_serve(self):
-        self.shutdown(force=True, idle=False)
+        self.shutdown(force=True)
         prserv.serv.auto_shutdown()
         if hasattr(bb.parse, "siggen"):
             bb.parse.siggen.exit()
@@ -1753,17 +1753,14 @@  class BBCooker:
         if hasattr(self, "data"):
             bb.event.fire(CookerExit(), self.data)
 
-    def shutdown(self, force=False, idle=True):
+    def shutdown(self, force=False):
         if force:
             self.state = state.forceshutdown
         else:
             self.state = state.shutdown
 
-        if idle:
-            self.waitIdle(30)
-
         if self.parser:
-            self.parser.shutdown(clean=not force)
+            self.parser.shutdown(clean=False)
             self.parser.final_cleanup()
 
     def finishcommand(self):
@@ -1775,6 +1772,7 @@  class BBCooker:
     def reset(self):
         if hasattr(bb.parse, "siggen"):
             bb.parse.siggen.exit()
+        self.finishcommand()
         self.initConfigurationData()
         self.handlePRServ()