]> arthur.barton.de Git - bup.git/commit
git: fix PackIdxList keeping deleted files open
authorJohannes Berg <johannes@sipsolutions.net>
Sat, 18 Jan 2020 21:26:16 +0000 (22:26 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sat, 25 Apr 2020 19:27:48 +0000 (14:27 -0500)
commit13ddba140c3f89f815ec774a4f8adbfe1867d33e
treede9914b0528a8bf3976772676e0f782b1262a013
parent6c6be9856a6e39c1d09ada270303abe44d4ab80d
git: fix PackIdxList keeping deleted files open

When an midx is deleted underneath bup, usually by itself running
'bup midx --auto', then PackIdxList may keep them open. This can
cause bup to run out of disk space easily since these files can
be fairly big, and can be recreated multiple times in a backup
run.

To fix this, remove any open PackMidx instances from the list and
close them explicitly.

Out of an abundance of caution, also explicitly close the bloom
instance if we have one - the same issue should apply here even if
I couldn't observe it, since the GC isn't guaranteed to clean up
the object immediately.

I remember debugging this issue years ago without coming to any
good conclusion, and it's been mentioned on the mailing list a few
times as well, e.g.
https://groups.google.com/d/msg/bup-list/AqIyv9n9WPE/-Wl2JVh5AQAJ

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
(cherry picked from commit 5c746e43600c059c52b5fd78212499e3e9700946)
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py