[bitbake-devel] cache: Optimise invalid cache file handling

Submitted by Richard Purdie on July 25, 2014, 1:52 p.m.


Message ID 1406296339.27697.25.camel@ted
State New
Headers show

Commit Message

Richard Purdie July 25, 2014, 1:52 p.m.
If there is a corrupt/invalid cache file, we'd keep trying to reopen
it. This is pointless, simplify the code paths and delete the dead 

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 6dedd4d..c7f3b7a 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -823,9 +823,11 @@  class MultiProcessCache(object):
                     p = pickle.Unpickler(fd)
                     extradata, version = p.load()
             except (IOError, EOFError):
-                extradata, version = self.create_cachedata(), None
+                os.unlink(f)
+                continue
             if version != self.__class__.CACHE_VERSION:
+                os.unlink(f)
             self.merge_data(extradata, data)