1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 01:37:20 +00:00

Merge pull request #2946 from ThomasWaldmann/workaround-files-cache-corruption

ignore corrupt files cache, fixes #2939
This commit is contained in:
enkore 2017-08-20 21:38:37 +02:00 committed by GitHub
commit 584886a22a

View file

@ -503,10 +503,16 @@ def _read_files(self):
if not data:
break
u.feed(data)
try:
for path_hash, item in u:
entry = FileCacheEntry(*item)
# in the end, this takes about 240 Bytes per file
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):
# Initialize transaction snapshot