From e8a8982bd761a29e10f9fc317ef36ffbc737e851 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 23 Feb 2018 23:39:02 -0800 Subject: [PATCH] gc.sh: disable gc for in-progress clones The mirror fetch operation is not prepared to handle a simultaneous garbage collection. It never has been. Although jobd.pl will not normally run gc.sh on an in-progress clone, it could be run through some other means. Therefore treat an in-progress clone the same as though it had a `.nogc` file, but with a slightly different disabled message. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jobd/gc.sh b/jobd/gc.sh index 45acd69..dbe4666 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -805,6 +805,10 @@ if [ -e .nogc ]; then progress "x [$proj] garbage check disabled" exit 0 fi +if ! [ -e .nofetch ] && [ -e .clone_in_progress ] && ! [ -e .clone_failed ]; then + progress "x [$proj] garbage check disabled (clone in progress)" + exit 0 +fi if [ -z "$isminigc" ] && [ -e .delaygc ] && [ -e .needsgc ]; then # Eligible for a full gc but .delaygc is set so it would be skipped # However .needsgc is also set so transform it into a mini instead -- 2.11.4.GIT