Skip to contentSkip to conversation

bitbake-worker: Add debug when unpickle fails

PATCH New Richard Purdie 1 participant 1 message Oct 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-worker: Add debug when unpickle fails

We occasionally see bitbake-worker failing and from the logs, an unpickle error occurs. Add more debug so we can further debug this next time it fails.

[YOCTO #14595]

---
 bin/bitbake-worker | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
bin/bitbake-worker +5 -1
index c8eb65567f..bf96207edc 100755
@@ -418,7 +418,11 @@ class BitbakeWorker(object):
         if self.queue.startswith(b"<" + item + b">"):
             index = self.queue.find(b"</" + item + b">")
             while index != -1:
-                func(self.queue[(len(item) + 2):index])
+                try:
+                    func(self.queue[(len(item) + 2):index])
+                except pickle.UnpicklingError:
+                    workerlog_write("Unable to unpickle data: %s\n" % ":".join("{:02x}".format(c) for c in self.queue))
+                    raise
                 self.queue = self.queue[(index + len(item) + 3):]
                 index = self.queue.find(b"</" + item + b">")
 
Signature · 1 line
2.32.0