diff options
author | mike o'brien <mpobrien005@gmail.com> | 2015-04-29 15:48:07 -0400 |
---|---|---|
committer | Ernie Hershey <ernie.hershey@10gen.com> | 2015-04-30 13:06:35 -0400 |
commit | c6d1d2403fc6b67204a90173c9b43eb4760a26a8 (patch) | |
tree | 61dff6c1379c8f332c180613d7827bbbf58ba9c0 /buildscripts | |
parent | 7a9aa99b21f9ed3251213aedd8c164fe28441dd9 (diff) | |
download | mongo-c6d1d2403fc6b67204a90173c9b43eb4760a26a8.tar.gz |
SERVER-18262 retry links download multiple times before failing
Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
(cherry picked from commit 9da229e234c2f903ff2569f3d9422b60d28dbf4e)
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/setup_multiversion_mongodb.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/buildscripts/setup_multiversion_mongodb.py b/buildscripts/setup_multiversion_mongodb.py index dcf65f77a76..740bed8b138 100644 --- a/buildscripts/setup_multiversion_mongodb.py +++ b/buildscripts/setup_multiversion_mongodb.py @@ -59,7 +59,17 @@ class MultiVersionDownloader : href = "http://dl.mongodb.org/dl/%s/%s" \ % (self.platform.lower(), self.arch) - html = urllib2.urlopen(href).read() + attempts_remaining = 5 + timeout_seconds = 10 + while True: + try: + html = urllib2.urlopen(href, timeout = timeout_seconds).read() + break + except Exception as e: + print "fetching links failed (%s), retrying..." % e + attempts_remaining -= 1 + if attempts_remaining == 0 : + raise Exception("Failed to get links after multiple retries") links = {} for line in html.split(): |