]> 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>
Thu, 13 Feb 2020 00:51:32 +0000 (18:51 -0600)
commit5c746e43600c059c52b5fd78212499e3e9700946
treee0c1bc0e78658bf4bdbd6261736e82e42ecd6b68
parent875cc0f8574b1bad6ae03f2d50430c0f0be8a319
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>
lib/bup/git.py