1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

Merge pull request #1643 from ThomasWaldmann/fix-1551

fix closed FD issue, fixes #1551
This commit is contained in:
enkore 2016-09-26 09:30:49 +02:00 committed by GitHub
commit e9486ec348

View file

@ -705,6 +705,13 @@ def iter_objects(self, segment, include_data=False):
else:
yield tag, key, offset
offset += size
# we must get the fd via get_fd() here again as we yielded to our caller and it might
# have triggered closing of the fd we had before (e.g. by calling io.read() for
# different segment(s)).
# by calling get_fd() here again we also make our fd "recently used" so it likely
# does not get kicked out of self.fds LRUcache.
fd = self.get_fd(segment)
fd.seek(offset)
header = fd.read(self.header_fmt.size)
def recover_segment(self, segment, filename):