[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: handle race conditions gracefully

Holger Levsen holger at moszumanska.debian.org
Fri Mar 13 16:36:46 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 88c565468c0c8bd7ef2cfefa66b88451d55fbb1a
Author: Holger Levsen <holger at layer-acht.org>
Date:   Fri Mar 13 17:34:33 2015 +0100

    reproducible: handle race conditions gracefully
---
 bin/reproducible_build.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 8750f78..f8efd22 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -148,6 +148,7 @@ else
 	SRCPKGID=$(echo $RESULT|cut -d "|" -f2)
 	SRCPACKAGE=$(echo $RESULT|cut -d "|" -f3)
 	SCHEDULED_DATE=$(echo $RESULT|cut -d "|" -f4)
+	create_results_dirs
 	echo "============================================================================="
 	echo "Trying to reproducibly build ${SRCPACKAGE} in ${SUITE} on ${ARCH} now."
 	echo "============================================================================="
@@ -157,7 +158,6 @@ else
 	DURATION=0
 	# mark build attempt
 	sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$SRCPKGID', '$SCHEDULED_DATE', '$DATE');"
-	create_results_dirs
 
 	RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_None.rbuild.log
 	echo "Starting to build ${SRCPACKAGE}/${SUITE} on $DATE" | tee ${RBUILDLOG}
@@ -191,7 +191,7 @@ else
 		# preserve RBUILDLOG as TMPLOG, then cleanup userContent from previous builds,
 		# and then access RBUILDLOG with it's correct name (=eversion)
 		TMPLOG=$(mktemp)
-		mv ${RBUILDLOG} ${TMPLOG}
+		mv ${RBUILDLOG} ${TMPLOG} || { echo  "Warning, package ${SRCPACKAGE} in ${SUITE} on ${ARCH} is probably already building elsewhere, exiting." ; echo  "Warning, package ${SRCPACKAGE} in ${SUITE} on ${ARCH} is probably already building elsewhere, exiting." | mail -s "race condition found" qa-jenkins-scm at lists.alioth.debian.org ; exit 0 }
 		cleanup_userContent
 		RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log
 		mv ${TMPLOG} ${RBUILDLOG}

-- 
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