Handle URLError timeout from Rietveld
While communicating to Rietveld, urllib2 request timed out and raised URLError, which was not handled in try_job_on_rietveld._update_jobs_from_rietveld() and propagated to the top CQ loop causing a crash. This patch fixes it.
BUG=337907
Review URL: https://codereview.chromium.org/144343006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/commit-queue@247376 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/verification/try_job_on_rietveld.py b/verification/try_job_on_rietveld.py
index b932f8e..359acb6 100644
--- a/verification/try_job_on_rietveld.py
+++ b/verification/try_job_on_rietveld.py
@@ -720,6 +720,14 @@
return False
else:
raise
+ except urllib2.URLError as e:
+ if 'timed out' in e.reason:
+ # Handle timeouts gracefully.
+ logging.warning('%s while updating tryserver status for '
+ 'rietveld issue %s', e, pending.issue)
+ return False
+ else:
+ raise
except socket.error as e:
# Temporary AppEngine hiccup. Just log it and return failure.
if e.errno == errno.ECONNRESET:
@@ -737,6 +745,7 @@
str(e), str(pending.issue)))
return False
raise
+
if handle:
for updated_key in keys:
job = jobs.try_jobs[updated_key]