Handle SSL timeouts in Rietveld requests.

BUG=346845
R=maruel@chromium.org

Review URL: https://codereview.chromium.org/180273003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253271 0039d316-1c4b-4281-b951-d872f2087c98
parent 5a306a2a
...@@ -18,6 +18,7 @@ import copy ...@@ -18,6 +18,7 @@ import copy
import json import json
import logging import logging
import re import re
import ssl
import time import time
import urllib2 import urllib2
...@@ -405,6 +406,11 @@ class Rietveld(object): ...@@ -405,6 +406,11 @@ class Rietveld(object):
not 'EOF occurred in violation of protocol' in e.reason): not 'EOF occurred in violation of protocol' in e.reason):
# Usually internal GAE flakiness. # Usually internal GAE flakiness.
raise raise
except ssl.SSLError, e:
if retry >= (maxtries - 1):
raise
if not 'timed out' in e.reason:
raise
# If reaching this line, loop again. Uses a small backoff. # If reaching this line, loop again. Uses a small backoff.
time.sleep(1+maxtries*2) time.sleep(1+maxtries*2)
finally: finally:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment