From 9b68f9606179bdbff544fef6dc3475a56d56b336 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 1 Aug 2025 15:37:53 +0100 Subject: bitbake: cooker: Ignore KeyErrors during shutdown When parsing failures occur, trap KeyError to avoid these kinds of tracebacks (from a parsing error in meta-ti). bb.parse.ParseError: ParseError at /srv/pokybuild/yocto-worker/check-layer-nightly/build/meta-ti/meta-ti-bsp/recipes-kernel/linux/linux-ti-mainline_git.bb:6: Could not inherit file classes/${KERNEL_BASE_CLASS}.bbclass During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/command.py", line 123, in runAsyncCommand self.cooker.updateCache() File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cooker.py", line 1639, in updateCache if not self.parser.parse_next(): File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cooker.py", line 2314, in parse_next self.shutdown(clean=False, eventmsg=str(exc)) File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cooker.py", line 2209, in shutdown read_results() File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cooker.py", line 2195, in read_results self.result_queue.get(timeout=0.25) File "/usr/lib/python3.10/multiprocessing/queues.py", line 122, in get return _ForkingPickler.loads(res) File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cache.py", line 338, in __setstate__ setattr(self, key, self._restore(state[key], pid)) File "/srv/pokybuild/yocto-worker/check-layer-nightly/build/lib/bb/cache.py", line 318, in _restore ret[dep] = map[mapnum] KeyError: 156 (Bitbake rev: 750c68ee7ee3f3d4518348e4c948243504880770) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2eb64ef237..9e4000b63c 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -2195,6 +2195,11 @@ class CookerParser(object): self.result_queue.get(timeout=0.25) except queue.Empty: break + except KeyError: + # The restore state from SiggenRecipeInfo in cache.py can + # fail here if this is an unclean shutdown since the state may have been + # reset. Ignore key errors for that reason, we don't care. + pass def sync_caches(): for c in self.bb_caches.values(): -- cgit v1.2.3-54-g00ecf