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

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

Issue 26564004: CQ: handle HTTP errors when accessing Rietveld (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 | « commit-queue/tests/try_job_on_rietveld_test.py ('k') | 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 227588)
+++ commit-queue/verification/try_job_on_rietveld.py (working copy)
@@ -633,19 +633,15 @@
return
self.last_update = now
- # First, update the status of the current pending CLs on Rietveld.
+ # Update the status of the current pending CLs on Rietveld.
for pending, jobs in self.loop(queue, RietveldTryJobs, True):
- self._update_jobs_from_rietveld(pending, jobs, True, now)
+ # Update 'now' since querying the try jobs may take a significant amount
+ # of time.
+ now = time.time()
+ if self._update_jobs_from_rietveld(pending, jobs, True, now):
+ # Send any necessary job. Noop if not needed.
+ self._send_jobs(pending, jobs, now)
- # Loop again serially on the PendingCommits to determine if new try jobs
- # should be sent.
- # Update 'now' since querying the try jobs may take a significant amount of
- # time.
- now = time.time()
- for pending, jobs in self.loop(queue, RietveldTryJobs, True):
- # Send any necessary job. Noop if not needed.
- self._send_jobs(pending, jobs, now)
-
def _add_pending_job_and_send_if_needed(self, builder, steps, jobs,
send_job, pending, now):
# Find if there was a previous try.
@@ -773,12 +769,28 @@
"""Grabs data from Rietveld and pass it to
RietveldTryJobs.update_jobs_from_rietveld().
- NOTE: While it is tagged as immutable, it is because it doesn't mutate
- TryRunnerRietveld itself but note that it does mutate 'pending'.
+ Returns True on success.
"""
status = buildbot_json.Buildbot(self.try_server_url)
- 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
+ elif e.code == 500:
+ # 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)
@@ -787,3 +799,5 @@
job = jobs.try_jobs[updated_key]
self._update_dashboard(pending, job, status)
jobs.signal_as_failed_if_needed(job, self._build_status_url(job), now)
+
+ return True
« no previous file with comments | « commit-queue/tests/try_job_on_rietveld_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698