Skip to content

Commit 9113dee

Browse files
committed
fix lock between gc and check
1 parent 2d6aee0 commit 9113dee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cvmfs/server/cvmfs_server_check.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ __do_check() {
4040
url=$CVMFS_STRATUM0
4141
fi
4242

43+
if [ "x$tag" = "x" ] && is_garbage_collectable $name; then
44+
# acquire gc lock
45+
# waits for gc on the same repository to finish
46+
# and prevents a gc from starting
47+
acquire_gc_lock $name check || die "Failed to acquire gc lock for $name"
48+
trap "release_gc_lock $name" EXIT HUP INT TERM
49+
fi
50+
4351
# do it!
4452
if [ $check_integrity -ne 0 ]; then
4553
if ! is_local_upstream $upstream; then
@@ -71,14 +79,6 @@ __do_check() {
7179
local with_reflog=
7280
has_reflog_checksum $name && with_reflog="-R $(get_reflog_checksum $name)"
7381

74-
if [ "x$tag" = "x" ] && is_garbage_collectable $name; then
75-
# acquire gc lock
76-
# waits for gc on the same repository to finish
77-
# and prevents a gc from starting
78-
acquire_gc_lock $name check || die "Failed to acquire gc lock for $name"
79-
trap "release_gc_lock $name" EXIT HUP INT TERM
80-
fi
81-
8282
local user_shell="$(get_user_shell $name)"
8383
local check_cmd
8484
check_cmd="$(__swissknife_cmd dbg) check $tag \

0 commit comments

Comments
 (0)