From 2b0817cbd3eade569bf8d3c65f6aa32c445b5220 Mon Sep 17 00:00:00 2001 From: Sven Mika Date: Thu, 7 May 2020 17:39:35 +0200 Subject: [PATCH] [RLlib] Retry pip installs (after waiting n seconds) in install-dependencies.sh (#8354) --- ci/travis/install-dependencies.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/travis/install-dependencies.sh b/ci/travis/install-dependencies.sh index bed0e8465..f94161f06 100755 --- a/ci/travis/install-dependencies.sh +++ b/ci/travis/install-dependencies.sh @@ -216,7 +216,20 @@ install_dependencies() { # These packages aren't Windows-compatible pip_packages+=(blist) # https://github.com/DanielStutzbach/blist/issues/81#issue-391460716 fi - CC=gcc pip install "${pip_packages[@]}" + + # Try n times; we often encounter OpenSSL.SSL.WantReadError (or others) + # that break the entire CI job: Simply retry installation in this case + # after n seconds. + local status="0"; + local errmsg=""; + for i in {1..3}; + do + errmsg=$(CC=gcc pip install "${pip_packages[@]}" 2>&1) && break; + status=$errmsg && echo "'pip install ...' failed, will retry after n seconds!" && sleep 30; + done + if [ "$status" != "0" ]; then + echo "${status}" && return 1 + fi fi if [ "${LINT-}" = 1 ]; then