Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: commit-queue/verification/try_job_on_rietveld.py

Issue 33443003: CQ: handle more error conditions in try_job_on_rietveld.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: commit-queue/verification/try_job_on_rietveld.py
===================================================================
--- commit-queue/verification/try_job_on_rietveld.py (revision 229881)
+++ commit-queue/verification/try_job_on_rietveld.py (working copy)
@@ -9,8 +9,10 @@
"""
import collections
+import errno
import logging
import re
+import socket
import time
import urllib2
@@ -773,27 +775,44 @@
"""
status = buildbot_json.Buildbot(self.try_server_url)
try:
- data = self.context.rietveld.get_patchset_properties(
- pending.issue, pending.patchset)
+ try:
+ data = self.context.rietveld.get_patchset_properties(
+ pending.issue, pending.patchset)
+ except urllib2.HTTPError as e:
+ if e.code == 404:
+ # TODO(phajdan.jr): Maybe generate a random id to correlate the user's
+ # error message and exception in the logs.
+ # Don't put exception traceback in the user-visible message to avoid
+ # leaking sensitive CQ data (passwords etc).
+ jobs.error_message = ('Failed to get patchset properties (patchset '
+ 'not found?)')
+ logging.error(str(e))
+ return False
+ else:
Isaac (away) 2013/10/24 17:25:41 Would this make more sense for rietveld.py to hand
Paweł Hajdan Jr. 2013/10/24 18:28:12 I don't think so. If anything, it might be better
Isaac (away) 2013/10/24 19:01:33 Python 3 supports native exception chaining. In P
+ raise
+
+ # Update the RietvedTryJobs object.
+ keys = jobs.update_jobs_from_rietveld(
+ pending.owner,
+ pending.issue,
+ data,
+ status,
+ self.context.checkout,
+ now)
except urllib2.HTTPError as e:
- if e.code == 404:
- # TODO(phajdan.jr): Maybe generate a random id to correlate the user's
- # error message and exception in the logs.
- # Don't put exception traceback in the user-visible message to avoid
- # leaking sensitive CQ data (passwords etc).
- jobs.error_message = ('Failed to get patchset properties (patchset '
- 'not found?)')
- logging.error(str(e))
- return False
- elif e.code == 500:
+ if e.code in (500, 502, 503):
# Temporary AppEngine hiccup. Just log it and return failure.
logging.warning(str(e))
return False
else:
raise
- # Update the RietvedTryJobs object.
- keys = jobs.update_jobs_from_rietveld(
- pending.owner, pending.issue, data, status, self.context.checkout, now)
+ except socket.error as e:
+ # Temporary AppEngine hiccup. Just log it and return failure.
+ if e.errno == errno.ECONNRESET:
Isaac (away) 2013/10/24 17:25:41 We're now raising if this doesn't match?
Paweł Hajdan Jr. 2013/10/24 18:28:12 If we're catching it here it means something in th
+ logging.warning(str(e))
+ return False
+ else:
+ raise
if handle:
for updated_key in keys:
job = jobs.try_jobs[updated_key]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698