]> source.dussan.org Git - jgit.git/commit
GC: Delete stale temporary packs and indexes 18/111018/4
authorHector Caballero <hector.caballero@ericsson.com>
Fri, 3 Nov 2017 18:39:37 +0000 (14:39 -0400)
committerHector Oswaldo Caballero <hector.caballero@ericsson.com>
Fri, 24 Nov 2017 10:13:24 +0000 (05:13 -0500)
commitbac4d32d39abc6fb9af61628adbed139ea442ee9
tree7788a3a2fe8143cefe2e179046228f05348f4ba2
parent03abd1dff21263a92ccf02e4178daef299398be2
GC: Delete stale temporary packs and indexes

When a GC operation is interrupted, temporary packs and indexes can be
left on the pack folder. In big, busy repositories this can lead to
significant amounts of wasted disk space if this interruption is done
with a certain frequency.

Remove stale temporary packs and indexes at the end of the GC process so
they do not accumulate. To avoid interfering with a possible concurrent
JGit GC process in the same repository, only delete temporary files that
are older than one day.

Change-Id: If9b6c1e57fac8a6a0ecc0a703089634caba4caae
Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTemporaryFilesTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java