From 02a89f564b285b2564229c3e869822e53458fa5e Mon Sep 17 00:00:00 2001 From: "kbr@chromium.org" Date: Fri, 14 Jan 2011 23:37:17 +0000 Subject: [PATCH] Work around App Engine flakiness by retrying upon URLError ("Connection timed out"). This allowed me to successfully upload a CL I have been stuck on for a couple of hours. BUG=none TEST=none Review URL: http://codereview.chromium.org/6345001 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71513 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/upload.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/third_party/upload.py b/third_party/upload.py index f7a2bf5d9..8be7029b0 100755 --- a/third_party/upload.py +++ b/third_party/upload.py @@ -402,6 +402,14 @@ class AbstractRpcServer(object): response = f.read() f.close() return response + except urllib2.URLError, e: + reason = e.reason + if isinstance(reason, str) and reason.find("110") != -1: + # Connection timeout error. + if tries <= 3: + # Try again. + continue + raise except urllib2.HTTPError, e: if tries > 3: raise