[Qa-jenkins-scm] [jenkins.debian.net] 04/06: reproducible: refactor, turn remote error irc notifications into mails

Holger Levsen holger at moszumanska.debian.org
Sat Oct 10 00:32:37 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 f11b3cc452f10a7e69746d9c3837243545332ea9
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sat Oct 10 02:16:09 2015 +0200

    reproducible: refactor, turn remote error irc notifications into mails
---
 bin/reproducible_build.sh       | 14 ++++++++++++--
 bin/reproducible_maintenance.sh |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index e131d87..b96c1d7 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -275,12 +275,22 @@ handle_unhandled() {
 	MESSAGE="$BUILD_URL met an unhandled $1, please check."
 	echo "$MESSAGE"
 	irc_message "$MESSAGE"
+	# no need to slow down
+	exec /srv/jenkins/bin/abort.sh
+	exit 0
+}
+
+handle_remote_error() {
+	unregister_build
+	MESSAGE="$BUILD_URL got remote $1"
+	echo "$(date -u ) - $MESSAGE" | tee -a /var/log/jenkins/reproducible-remote-error.log
 	echo "Sleeping 5m before aborting the job."
 	sleep 5m
 	exec /srv/jenkins/bin/abort.sh
 	exit 0
 }
 
+
 handle_enospace() {
 	unregister_build
 	MESSAGE="$BUILD_URL hit diskspace issues with $SRCPACKAGE on $SUITE/$ARCH, sleeping 30m."
@@ -607,7 +617,7 @@ remote_build() {
 	if [ $RESULT -eq 148 ] ; then
 		handle_404
 	elif [ $RESULT -ne 0 ] ; then
-		handle_unhandled "exit code from remote build job"
+		handle_remote_error "with exit code $RESULT from $NODE for build #$BUILDNR for ${SRCPACKAGE} on ${SUITE}/${ARCH}"
 	fi
 	rsync -e "ssh -p $PORT" -r $NODE:$TMPDIR/b$BUILDNR $TMPDIR/
 	RESULT=$?
@@ -617,7 +627,7 @@ 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"
+			handle_remote_error "when rsyncing remote build #$BUILDNR results from $NODE"
 		fi
 	fi
 	ls -R $TMPDIR
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 88ea9df..7f68312 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -329,7 +329,7 @@ fi
 # daily mails
 if [ "$HOSTNAME" = "$MAINNODE" ] && [ $(date -u +%H) -eq 0 ]  ; then
 	# once a day, send mail about builder problems
-	for PROBLEM in /var/log/jenkins/stale_builds.log /var/log/jenkins/reproducible-race-conditions.log /var/log/jenkins/reproducible-diskspace-issues.log ; do
+	for PROBLEM in /var/log/jenkins/stale_builds.log /var/log/jenkins/reproducible-race-conditions.log /var/log/jenkins/reproducible-diskspace-issues.log /var/log/jenkins/reproducible-remote-error.log; do
 		if [ -s $PROBLEM ] ; then
 			TMPFILE=$(mktemp --tmpdir=$TEMPDIR maintenance-XXXXXXXXXXXX)
 			mv $PROBLEM $TMPFILE

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