Skip to contentSkip to conversation

cooker/siggen: Reset siggen when reparsing

PATCH New Richard Purdie 1 participant 2 messages Aug 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cooker/siggen: Reset siggen when reparsing

If we don't do this, we get basehash mismatch errors occurring from the reparse which would then set bitbake's error exit code.

This for example would cause oe-selftest -r bbtests.BitbakeTests.test_bbappend_order to fail with a non-zero BB_SERVER_TIMEOUT.

---
 lib/bb/cooker.py | 1 +
 lib/bb/siggen.py | 3 +++
 2 files changed, 4 insertions(+)
lib/bb/cooker.py +1 -0
index 81027db..3740c61 100644
@@ -1468,6 +1468,7 @@ class BBCooker:
             self.updateCacheSync()
 
         if self.state != state.parsing and not self.parsecache_valid:
+            bb.parse.siggen.reset(self.data)
             self.parseConfiguration ()
             if CookerFeatures.SEND_SANITYEVENTS in self.featureset:
                 for mc in self.multiconfigs:
lib/bb/siggen.py +3 -0
index f71190a..4380760 100644
@@ -94,6 +94,9 @@ 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.7.4
#1 lore raw

PATCH 2/2 server/process: Ensure we don't loop on client EOFError

The server currently crashes if we hit an EOFError due to controllersock still being in ready and the continue meaning ready isn't re-evaluated. Setting the value to False can mean the shutdown code doesn't handle the situation cleanly.

Clear ready to avoid the crash/loop instead and handle any OSError whilst we're in here.

---
 lib/bb/server/process.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/server/process.py +2 -2
index 338c448..ee8b14e 100644
@@ -164,7 +164,7 @@ class ProcessServer(multiprocessing.Process):
 
                     self.haveui = True
 
-                except EOFError:
+                except (EOFError, OSError):
                     print("Disconnecting Client")
                     fds.remove(self.controllersock)
                     fds.remove(self.command_channel)
@@ -190,7 +190,7 @@ class ProcessServer(multiprocessing.Process):
                     command = self.command_channel.get()
                 except EOFError:
                     # Client connection shutting down
-                    self.command_channel = False
+                    ready = []
                     continue
                 if command[0] == "terminateServer":
                     self.quit = True
Signature · 1 line
2.7.4