mirror of https://github.com/borgbackup/borg.git
ignore corrupt files cache, fixes #2939
ignore the files cache when corrupt and emit a warning message so the users notices that there is a problem.
This commit is contained in:
parent
edda2e6989
commit
5beaa5bd02
|
@ -208,10 +208,16 @@ Chunk index: {0.total_unique_chunks:20d} {0.total_chunks:20d}"""
|
||||||
if not data:
|
if not data:
|
||||||
break
|
break
|
||||||
u.feed(data)
|
u.feed(data)
|
||||||
for path_hash, item in u:
|
try:
|
||||||
item[0] += 1
|
for path_hash, item in u:
|
||||||
# in the end, this takes about 240 Bytes per file
|
item[0] += 1
|
||||||
self.files[path_hash] = msgpack.packb(item)
|
# in the end, this takes about 240 Bytes per file
|
||||||
|
self.files[path_hash] = msgpack.packb(item)
|
||||||
|
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