Commit b42bce50 authored by Ned Nguyen's avatar Ned Nguyen Committed by Commit Bot

Retry uploading to perf dashboard in cases server reponses 500

Bug: 864565
Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi
Change-Id: I8ae19f0318802404f354fc474a62299aad713afd
Reviewed-on: https://chromium-review.googlesource.com/1149582
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: default avatarSimon Hatch <simonhatch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577953}
parent e3960543
...@@ -148,7 +148,7 @@ def _SendResultsToDashboard( ...@@ -148,7 +148,7 @@ def _SendResultsToDashboard(
error = 'Error while uploading %s data: %s' % (data_type, str(e)) error = 'Error while uploading %s data: %s' % (data_type, str(e))
errors.append(error) errors.append(error)
except SendResultsFatalException as e: except SendResultsFatalException as e:
error = 'Error uploading %s data: %s' % (data_type, str(e)) error = 'Fatal error while uploading %s data: %s' % (data_type, str(e))
errors.append(error) errors.append(error)
break break
except Exception: except Exception:
...@@ -499,10 +499,10 @@ def _SendHistogramJson(url, histogramset_json, oauth_token): ...@@ -499,10 +499,10 @@ def _SendHistogramJson(url, histogramset_json, oauth_token):
# A 500 is presented on an exception on the dashboard side, timeout, # A 500 is presented on an exception on the dashboard side, timeout,
# exception, etc. The dashboard can also send back 400 and 403, we could # exception, etc. The dashboard can also send back 400 and 403, we could
# recover from 403 (auth error), but 400 is generally malformed data. # recover from 403 (auth error), but 400 is generally malformed data.
if response.status == 403: if response.status in (403, 500):
raise SendResultsRetryException(traceback.format_exc()) raise SendResultsRetryException('HTTP Response %d: %s' % (
response.status, response.reason))
if response.status != 200: elif response.status != 200:
raise SendResultsFatalException('HTTP Response %d: %s' % ( raise SendResultsFatalException('HTTP Response %d: %s' % (
response.status, response.reason)) response.status, response.reason))
except httplib2.HttpLib2Error: except httplib2.HttpLib2Error:
......
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