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 12:37:15 -0400 |
commit | 9da229e234c2f903ff2569f3d9422b60d28dbf4e (patch) | |
tree | e88a5913977b0fa4e30ac0862cf0dddcbe9248b7 /buildscripts/setup_multiversion_mongodb.py | |
parent | 5a59debb349c34397a405e92d41e0ece433d7ba4 (diff) | |
download | mongo-9da229e234c2f903ff2569f3d9422b60d28dbf4e.tar.gz |
SERVER-18262 retry links download multiple times before failing
Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
Diffstat (limited to 'buildscripts/setup_multiversion_mongodb.py')
-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 9ba9fbf4983..01c6fdeb1db 100644 --- a/buildscripts/setup_multiversion_mongodb.py +++ b/buildscripts/setup_multiversion_mongodb.py @@ -76,7 +76,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(): |