Patchwork [bitbake-devel] cooker/command: Add error state for the server and use for pre_serve errors

mail settings
Submitter Richard Purdie
Date Oct. 6, 2013, 12:42 p.m.
Message ID <1381063359.30971.21.camel@ted>
Download mbox | patch
Permalink /patch/59325/
State New
Headers show


Richard Purdie - Oct. 6, 2013, 12:42 p.m.
Currently if errors occur when starting the PR service, there is a race that
occurs since the UI runs various commands including starting builds before
processing the CookerExit(). By adding the error state and refusing to run
async commands in this mode, builds are prevented from starting and the
UI reaches the exit code with the system shutting down cleanly.

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 3ca27a6..a2795ce 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -86,6 +86,8 @@  class Command:
     def runAsyncCommand(self):
+            if self.cooker.state == bb.cooker.state.error:
+                return False
             if self.currentAsyncCommand is not None:
                 (command, options) = self.currentAsyncCommand
                 commandmethod = getattr(CommandsAsync, command)
diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index d17716d..870b18e 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -61,7 +61,7 @@  class CollectionError(bb.BBHandledException):
 class state:
-    initial, parsing, running, shutdown, forceshutdown, stopped = range(6)
+    initial, parsing, running, shutdown, forceshutdown, stopped, error = range(7)
 class SkippedPackage:
@@ -1321,6 +1321,7 @@  class BBCooker:
             self.prhost = prserv.serv.auto_start(
         except prserv.serv.PRServiceConfigError:
   , self.event_data)
+            self.state = state.error
     def post_serve(self):