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:
commit
e9486ec348
1 changed files with 7 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue