From 79adf16931f9f7079f98fe7f58c6a67a7723c6c9 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 12 Sep 2020 15:25:04 +0100 Subject: bitbake: 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. (Bitbake rev: 12605e30e4c4e1ae6a67c97363b892ebf0b9566c) Signed-off-by: Richard Purdie --- bitbake/lib/bb/command.py | 3 ++- bitbake/lib/bb/cooker.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index d4dcc653a0..f8c6a03bb9 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/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/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index e45755206e..58c223c1ca 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf