All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cache: Optimise invalid cache file handling
@ 2014-07-25 13:52 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2014-07-25 13:52 UTC (permalink / raw)
  To: bitbake-devel

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 
file.

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

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)
                 continue
 
             self.merge_data(extradata, data)




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-25 13:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 13:52 [PATCH] cache: Optimise invalid cache file handling Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.