Skip to contentSkip to conversation

A couple of signature fixes

PATCH In review Paul Eggleton 1 participant 4 messages Sep 4, 2017

lore
Share & tools
lore
#0 lore raw

cover A couple of signature fixes

A fix for taskhash mismatch errors seen with BB_SERVER_TIMEOUT set as well as a cleanup patch for siggen.py.

The following changes since commit 7234f33a7eb38ad51a8345f6689bc26e29f29f92:

cooker: Ensure parseConfiguration clears parsecache_valid (2017-09-01 16:59:35 +0100)

are available in the git repository at:

git://git.openembedded.org/bitbake-contrib paule/sigfixes
http://cgit.openembedded.org/bitbake-contrib/log/?h=paule/sigfixes

Paul Eggleton (2):
cooker: clear extra config settings and remote datastores on client
disconnect
siggen: move reset() definition to base SignatureGenerator class

 lib/bb/command.py | 3 +++
 lib/bb/cooker.py  | 2 ++
 lib/bb/siggen.py  | 6 ++----
 3 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.9.5
#1 lore raw

PATCH 1/2 cooker: clear extra config settings and remote datastores on client disconnect

When the UI disconnects, we can throw away any server-side remote datastores we created in response to calls from the UI, and we *must* drop everything in extraconfigdata or it will taint any future operations.

Dropping extraconfigdata upon disconnect fixes taskhash mismatch errors when running devtool.DevtoolTests.test_devtool_update_recipe_local_files within oe-selftest with BB_SERVER_TIMEOUT=100 in OpenEmbedded.

---
 lib/bb/command.py | 3 +++
 lib/bb/cooker.py  | 2 ++
 2 files changed, 5 insertions(+)
lib/bb/command.py +3 -0
index 0d0354c..67cc5ce 100644
@@ -145,6 +145,9 @@ class Command:
         self.currentAsyncCommand = None
         self.cooker.finishcommand()
 
+    def reset(self):
+        self.remotedatastores = bb.remotedata.RemoteDatastores(cooker)
+
 def split_mc_pn(pn):
     if pn.startswith("multiconfig:"):
         _, mc, pn = pn.split(":", 2)
lib/bb/cooker.py +2 -0
index f5ae831..10cb8be 100644
@@ -1616,6 +1616,8 @@ class BBCooker:
     def clientComplete(self):
         """Called when the client is done using the server"""
         self.finishcommand()
+        self.extraconfigdata = {}
+        self.command.reset()
         self.databuilder.reset()
         self.data = self.databuilder.data
 
Signature · 1 line
2.9.5
#2 lore raw

Re: [PATCH 1/2] cooker: clear extra config settings and remote datastores on client disconnect

lib/bb/command.py class Command: · line 150

Quoted 3 lines · NZST Paul Eggleton
lib/bb/command.py +3 -0
+    def reset(self):
+        self.remotedatastores = bb.remotedata.RemoteDatastores(cooker)
+

Oops, that should have been self.cooker - I only noticed when I happened to look at bitbake-cookerdaemon.log. I've re-pushed the branch with that fixed.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw

PATCH 2/2 siggen: move reset() definition to base SignatureGenerator class

In reply to Paul Eggleton

If we're implementing reset() in SignatureGenerator at all (and we need to for a basic non-OE BitBake setup where that is the default signature generator), then we need it to be clearing out the internal values properly.

---
 lib/bb/siggen.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
lib/bb/siggen.py +2 -4
index 7521a3a..5ef82d7 100644
@@ -70,7 +70,8 @@ class SignatureGenerator(object):
         self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash = data
 
     def reset(self, data):
-        return
+        self.__init__(data)
+
 
 class SignatureGeneratorBasic(SignatureGenerator):
     """
@@ -97,9 +98,6 @@ class SignatureGeneratorBasic(SignatureGenerator):
         else:
             self.checksum_cache = None
 
-    def reset(self, data):
-        self.__init__(data)
-
     def init_rundepcheck(self, data):
         self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
         if self.taskwhitelist:
Signature · 1 line
2.9.5