mirror of https://github.com/borgbackup/borg.git
Merge pull request #2945 from ThomasWaldmann/workaround-files-cache-corruption-1.1
ignore corrupt files cache, fixes #2939
This commit is contained in:
commit
1a05e8f446
|
@ -503,10 +503,16 @@ class LocalCache(CacheStatsMixin):
|
||||||
if not data:
|
if not data:
|
||||||
break
|
break
|
||||||
u.feed(data)
|
u.feed(data)
|
||||||
|
try:
|
||||||
for path_hash, item in u:
|
for path_hash, item in u:
|
||||||
entry = FileCacheEntry(*item)
|
entry = FileCacheEntry(*item)
|
||||||
# in the end, this takes about 240 Bytes per file
|
# in the end, this takes about 240 Bytes per file
|
||||||
self.files[path_hash] = msgpack.packb(entry._replace(age=entry.age + 1))
|
self.files[path_hash] = msgpack.packb(entry._replace(age=entry.age + 1))
|
||||||
|
except (TypeError, ValueError) as exc:
|
||||||
|
logger.warning('The files cache seems corrupt, ignoring it. '
|
||||||
|
'Expect lower performance. [%s]' % str(exc))
|
||||||
|
self.files = {}
|
||||||
|
return
|
||||||
|
|
||||||
def begin_txn(self):
|
def begin_txn(self):
|
||||||
# Initialize transaction snapshot
|
# Initialize transaction snapshot
|
||||||
|
|
Loading…
Reference in New Issue