You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/07/31 17:39:12 UTC

[arrow] branch master updated: ARROW-2949: [CI] Add retry logic when downloading miniconda to reduce flakiness

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new beefaca  ARROW-2949: [CI] Add retry logic when downloading miniconda to reduce flakiness
beefaca is described below

commit beefaca96fc67ec0bacfc74a72a6e76729b92194
Author: Wes McKinney <we...@apache.org>
AuthorDate: Tue Jul 31 13:39:07 2018 -0400

    ARROW-2949: [CI] Add retry logic when downloading miniconda to reduce flakiness
    
    Not the most elegant, but hopefully this will do the trick
    
    Author: Wes McKinney <we...@apache.org>
    
    Closes #2349 from wesm/ARROW-2949 and squashes the following commits:
    
    cc9facf5 <Wes McKinney> Fix bash fehler
    af19d51f <Wes McKinney> Add retry logic when downloading miniconda to reduce flakiness
---
 ci/travis_install_conda.sh | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/ci/travis_install_conda.sh b/ci/travis_install_conda.sh
index 7896b12..de4a7ac 100755
--- a/ci/travis_install_conda.sh
+++ b/ci/travis_install_conda.sh
@@ -19,17 +19,39 @@
 
 set -e
 
+if [ $TRAVIS_OS_NAME == "linux" ]; then
+  MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
+else
+  MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
+fi
+
+function download_miniconda() {
+  wget --no-verbose -O miniconda.sh $MINICONDA_URL
+}
+
+
 if (! which conda > /dev/null ); then
-  if [ $TRAVIS_OS_NAME == "linux" ]; then
-    MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
-  else
-    MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
-  fi
 
   source $TRAVIS_BUILD_DIR/ci/travis_env_common.sh
   mkdir -p $CONDA_PKGS_DIRS
 
-  wget --no-verbose -O miniconda.sh $MINICONDA_URL
+  CONDA_RETRIES=5
+  until [ $CONDA_RETRIES -eq 0 ]
+  do
+      # If wget fails to resolve the repo.continuum.io host in the DNS, it will
+      # exit rather than retrying with backoff like other kinds of failures. We
+      # sleep for a few seconds and retry a number of times to reduce flakiness
+      download_miniconda && break
+      echo "Unable to connect to repo.continuum.io, waiting and then retrying"
+      CONDA_RETRIES=$[$CONDA_RETRIES - 1]
+      sleep 5
+  done
+  if [ $CONDA_RETRIES -eq 0 ]; then
+     # If we failed to download, try again so the error message will be visible
+     # in Travis CI logs
+     download_miniconda
+  fi
+
   bash miniconda.sh -b -p $MINICONDA
   export PATH="$MINICONDA/bin:$PATH"