Skip to content

Commit bbc2294

Browse files
authored
Merge pull request #301 from github/snh/catch-nonzero
Improve detection of failures in cluster backup rsync threads
2 parents 25c304f + edca51a commit bbc2294

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

share/github-backup-utils/ghe-backup-repositories-cluster-ng

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,15 @@ mkdir -p "$backup_dir"
9494
# Removes the remote sync-in-progress file on exit, re-enabling GC operations
9595
# on the remote instance.
9696
cleanup() {
97+
for pid in $(jobs -p); do
98+
kill -KILL $pid > /dev/null 2>&1 || true
99+
done
100+
97101
# Enable remote GC operations
98102
for hostname in $hostnames; do
99103
ghe-gc-enable -F $config_file $hostname:$port
100104
done
105+
101106
rm -f $config_file
102107
rm -rf $tempdir
103108
}
@@ -322,7 +327,10 @@ for file_list in $tempdir/*.rsync; do
322327

323328
sync_data $hostname $file_list &
324329
done
325-
wait
330+
331+
for pid in $(jobs -p); do
332+
wait $pid
333+
done
326334
bm_end "$(basename $0) - Repo sync"
327335

328336
# Since there are no routes for special data directories

0 commit comments

Comments
 (0)