From 8039e854aae833f5e62c3f63d1fa5be508c8fcaf Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 29 Apr 2015 06:56:55 -0400 Subject: [PATCH] fix git_timed retry logic git_timed retry logic actually only retried *if* we timed out, not if the command itself failed, as it would explicitly exit if the return code was anything except 124. This loops in all failure cases, which was the intent of the original fix. Related-Bug: #1282876 Change-Id: I576df4832665beb21992ffa873da28a198018530 --- jenkins/scripts/gerrit-git-prep.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/jenkins/scripts/gerrit-git-prep.sh b/jenkins/scripts/gerrit-git-prep.sh index 2f5eada12b..df655ca5c1 100755 --- a/jenkins/scripts/gerrit-git-prep.sh +++ b/jenkins/scripts/gerrit-git-prep.sh @@ -19,14 +19,7 @@ function git_timed { fi until timeout -s SIGINT ${timeout} git "$@"; do - # 124 is timeout(1)'s special return code when it reached the - # timeout; otherwise assume fatal failure - if [[ $? -ne 124 ]]; then - exitcode=$? - echo $LINENO "git call failed: [git $@]" - exit $exitcode - fi - + echo "Command exited with '$?' [git $@] ... retrying" count=$(($count + 1)) echo "timeout ${count} for git call: [git $@]" if [ $count -eq 3 ]; then