]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cooker: make sure state is properly used to accept clients
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Fri, 6 Mar 2015 15:37:25 +0000 (15:37 +0000)
committerAlexandru DAMIAN <alexandru.damian@intel.com>
Mon, 9 Mar 2015 13:15:20 +0000 (13:15 +0000)
This patch fixes a bug where if the build is force stopped,
subsequent clients cannot connect to the server due to
unnecessary limits on setFeature.

Additionally, we make sure that the state is properly reset
even if the BuildCompleted event firing excepts for some reason.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
lib/bb/cooker.py

index 5ebf6a1328a917992f4c33511bea96e282bc1f44..57fb58157e3f5dc6ab4a26f65662a1e20a4c6565 100644 (file)
@@ -229,7 +229,7 @@ class BBCooker:
 
     def setFeatures(self, features):
         # we only accept a new feature set if we're in state initial, so we can reset without problems
-        if self.state != state.initial and self.state != state.error:
+        if not self.state in [state.initial, state.shutdown, state.forceshutdown, state.stopped, state.error]:
             raise Exception("Illegal state for feature set change")
         original_featureset = list(self.featureset)
         for feature in features:
@@ -1303,8 +1303,8 @@ class BBCooker:
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.expanded_data)
                 self.command.finishAsyncCommand(msg)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.expanded_data)
                 return False
             if retval is True:
                 return True
@@ -1336,8 +1336,8 @@ class BBCooker:
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data)
                 self.command.finishAsyncCommand(msg)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data)
                 return False
             if retval is True:
                 return True