From b611de9429d94a113cc08103c86877e103ea8de4 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Fri, 6 Mar 2015 15:37:25 +0000 Subject: bitbake: cooker: make sure state is properly used to accept clients 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. (Bitbake rev: 0b66b05169688aa4ddc4c54d175bb961b2f27fec) Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 5ebf6a1328..57fb58157e 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -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 -- cgit v1.2.3-54-g00ecf