[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible: retry rsync on failure but sleep 5min before doing so

Holger Levsen holger at moszumanska.debian.org
Mon Sep 7 15:57:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit f1fef99224089d7d41b953aea1232f429c180687
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Sep 7 17:56:46 2015 +0200

    reproducible: retry rsync on failure but sleep 5min before doing so
---
 bin/reproducible_build.sh | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 58bea99..27a82b2 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -407,9 +407,9 @@ get_source_package() {
 	if [ $RESULT != 0 ] || [ "$(ls ${SRCPACKAGE}_*.dsc 2> /dev/null)" = "" ] ; then
 		# sometimes apt-get cannot download a package for whatever reason.
 		# if so, wait some time and try again. only if that fails, give up.
-		echo "Download of ${SRCPACKAGE} sources from ${SUITE} failed." | tee -a ${RBUILDLOG}
+		echo "$(date -u ) - download of ${SRCPACKAGE} sources from ${SUITE} failed." | tee -a ${RBUILDLOG}
 		ls -l ${SRCPACKAGE}* | tee -a ${RBUILDLOG}
-		echo "Sleeping 5m before re-trying..." | tee -a ${RBUILDLOG}
+		echo "$(date -u ) - sleeping 5m before re-trying..." | tee -a ${RBUILDLOG}
 		sleep 5m
 		schroot --directory $TMPDIR -c source:jenkins-reproducible-$SUITE apt-get -- --download-only --only-source source ${SRCPACKAGE} 2>&1 | tee -a ${RBUILDLOG}
 		RESULT=$?
@@ -514,7 +514,13 @@ remote_build() {
 	rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/
 	RESULT=$?
 	if [ $RESULT -ne 0 ] ; then
-		handle_unhandled "error when rsyncing remote build results"
+		echo "$(date -u ) - rsync from $NODE failed, sleeping 5m before re-trying..." | tee -a ${RBUILDLOG}
+		sleep 5m
+		rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/
+		RESULT=$?
+		if [ $RESULT -ne 0 ] ; then
+			handle_unhandled "error when rsyncing remote build results"
+		fi
 	fi
 	ls -R $TMPDIR
 	ssh -p $PORT $NODE "rm -r $TMPDIR"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list