diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-12 15:25:04 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-12 15:29:39 +0100 |
commit | 12605e30e4c4e1ae6a67c97363b892ebf0b9566c (patch) | |
tree | e2012dcd26750c5fcf73f7b4a588efec0267c855 | |
parent | b69e97de53eb172ed730993e3b755debaa26f30d (diff) | |
download | bitbake-12605e30e4c4e1ae6a67c97363b892ebf0b9566c.tar.gz |
cooker/command: Fix disconnection handling
After the recent init changes, if a client disconnects before issuing a
command, the cooker can break in the reset handlers. Add some guards
in the code to prevent this.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/command.py | 3 | ||||
-rw-r--r-- | lib/bb/cooker.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py index d4dcc653a..f8c6a03bb 100644 --- a/lib/bb/command.py +++ b/lib/bb/command.py @@ -143,7 +143,8 @@ class Command: self.cooker.finishcommand() def reset(self): - self.remotedatastores = bb.remotedata.RemoteDatastores(self.cooker) + if self.remotedatastores: + self.remotedatastores = bb.remotedata.RemoteDatastores(self.cooker) class CommandsSync: """ diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index e45755206..58c223c1c 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1703,8 +1703,9 @@ class BBCooker: self.finishcommand() self.extraconfigdata = {} self.command.reset() - self.databuilder.reset() - self.data = self.databuilder.data + if hasattr(self, "data"): + self.databuilder.reset() + self.data = self.databuilder.data self.parsecache_valid = False self.baseconfig_valid = False |