mirror of https://github.com/borgbackup/borg.git
Clean up fds of segments we delete (during compaction)
When we delete a segment, let's close its fd as well. Note as well wasting the fd, this was forcing the filesystem to preserve the deleted file until we exited. I noticed roughly 20 open fds of deleted files when attic saved 10G of data.
This commit is contained in:
parent
2b348104f6
commit
57845c07ed
|
@ -478,6 +478,9 @@ class LoggedIO(object):
|
|||
return fd
|
||||
|
||||
def delete_segment(self, segment):
|
||||
fd = self.fds.pop(segment)
|
||||
if fd != None:
|
||||
fd.close()
|
||||
try:
|
||||
os.unlink(self.segment_filename(segment))
|
||||
except OSError:
|
||||
|
|
Loading…
Reference in New Issue