summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-12-18 14:46:57 +0100
committerHolger Levsen <holger@layer-acht.org>2015-12-18 14:46:57 +0100
commit0d22990497fa790ea01ef6e93513f7123c189dfc (patch)
treee12935cbce3e873989f16778580a5a10b13019f4
parent1ac3a03f9a48b2e7a5f81c445cae598fa4b4fddd (diff)
downloadjenkins.debian.net-0d22990497fa790ea01ef6e93513f7123c189dfc.tar.xz
reproducible archlinux: detect if schroot session cannot be closed properly, then retry, else abort loudly
-rwxr-xr-xbin/reproducible_build_archlinux_pkg.sh31
1 files changed, 28 insertions, 3 deletions
diff --git a/bin/reproducible_build_archlinux_pkg.sh b/bin/reproducible_build_archlinux_pkg.sh
index 9ccf43bf..3cf3eeab 100755
--- a/bin/reproducible_build_archlinux_pkg.sh
+++ b/bin/reproducible_build_archlinux_pkg.sh
@@ -138,7 +138,17 @@ first_build() {
if [ $PRESULT -eq 124 ] ; then
echo "$(date -u) - makepkg was killed by timeout after ${TIMEOUT}h." | tee -a $LOG
fi
- schroot --end-session -c $SESSION
+ schroot --end-session -c $SESSION | tee -a $LOG
+ PRESULT=${PIPESTATUS[0]}
+ if [ $PRESULT -ne 0 ] ; then
+ echo "$(date -u) - could not end schroot session, maybe some processes are still running? Sleeping 30 seconds and trying again…" | tee -a $LOG
+ sleep 30
+ schroot --end-session -c $SESSION | tee -a $LOG
+ P2RESULT=${PIPESTATUS[0]}
+ if [ $P2RESULT -ne 0 ] ; then
+ exit 23
+ fi
+ fi
if ! "$DEBUG" ; then set +x ; fi
}
@@ -172,7 +182,17 @@ second_build() {
if [ $PRESULT -eq 124 ] ; then
echo "$(date -u) - makepkg was killed by timeout after ${TIMEOUT}h." | tee -a $LOG
fi
- schroot --end-session -c $SESSION
+ schroot --end-session -c $SESSION | tee -a $LOG
+ PRESULT=${PIPESTATUS[0]}
+ if [ $PRESULT -ne 0 ] ; then
+ echo "$(date -u) - could not end schroot session, maybe some processes are still running? Sleeping 30 seconds and trying again…" | tee -a $LOG
+ sleep 30
+ schroot --end-session -c $SESSION | tee -a $LOG
+ P2RESULT=${PIPESTATUS[0]}
+ if [ $P2RESULT -ne 0 ] ; then
+ exit 23
+ fi
+ fi
if ! "$DEBUG" ; then set +x ; fi
}
@@ -195,7 +215,12 @@ remote_build() {
RESULT=$?
if [ $RESULT -ne 0 ] ; then
ssh -p $PORT $FQDN "rm -r $TMPDIR" || true
- handle_remote_error "with exit code $RESULT from $NODE for build #$BUILDNR for ${SRCPACKAGE} from $REPOSITORY"
+ if [ $RESULT -eq 23 ] ; then
+ echo "remote job could not end schroot session properly, failing loudly so we get a pointer for investigations."
+ exit 1
+ else
+ handle_remote_error "with exit code $RESULT from $NODE for build #$BUILDNR for ${SRCPACKAGE} from $REPOSITORY"
+ fi
fi
rsync -e "ssh -p $PORT" -r $FQDN:$TMPDIR/b$BUILDNR $TMPDIR/
RESULT=$?