Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 """Defines class Rietveld to easily access a rietveld instance. | 5 """Defines class Rietveld to easily access a rietveld instance. |
| 6 | 6 |
| 7 Security implications: | 7 Security implications: |
| 8 | 8 |
| 9 The following hypothesis are made: | 9 The following hypothesis are made: |
| 10 - Rietveld enforces: | 10 - Rietveld enforces: |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 raise | 427 raise |
| 428 if (not 'Name or service not known' in e.reason and | 428 if (not 'Name or service not known' in e.reason and |
| 429 not 'EOF occurred in violation of protocol' in e.reason): | 429 not 'EOF occurred in violation of protocol' in e.reason): |
| 430 # Usually internal GAE flakiness. | 430 # Usually internal GAE flakiness. |
| 431 raise | 431 raise |
| 432 except ssl.SSLError, e: | 432 except ssl.SSLError, e: |
| 433 if retry >= (maxtries - 1): | 433 if retry >= (maxtries - 1): |
| 434 raise | 434 raise |
| 435 if not 'timed out' in str(e): | 435 if not 'timed out' in str(e): |
| 436 raise | 436 raise |
| 437 # If reaching this line, loop again. Uses a small backoff. | 437 # If reaching this line, loop again. Uses an exponential backoff. |
| 438 time.sleep(1+maxtries*2) | 438 time.sleep(1+5**retry) |
|
M-A Ruel
2014/06/11 13:27:41
5**3 = 125. That's a hell of a long time.
I don't
Sergiy Byelozyorov
2014/06/11 15:46:42
I guess what I didn't consider is interactive usag
M-A Ruel
2014/06/11 17:52:48
Oh, I'm concerned about try jobs what would get st
Sergiy Byelozyorov
2014/06/12 09:43:50
Why is this an issue? We only wait extra few minut
M-A Ruel
2014/06/12 12:18:07
Yes but I don't know if you specifically looked at
| |
| 439 finally: | 439 finally: |
| 440 upload.ErrorExit = old_error_exit | 440 upload.ErrorExit = old_error_exit |
| 441 | 441 |
| 442 # DEPRECATED. | 442 # DEPRECATED. |
| 443 Send = get | 443 Send = get |
| 444 | 444 |
| 445 | 445 |
| 446 class OAuthRpcServer(object): | 446 class OAuthRpcServer(object): |
| 447 def __init__(self, | 447 def __init__(self, |
| 448 host, | 448 host, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 def trigger_try_jobs( # pylint:disable=R0201 | 717 def trigger_try_jobs( # pylint:disable=R0201 |
| 718 self, issue, patchset, reason, clobber, revision, builders_and_tests, | 718 self, issue, patchset, reason, clobber, revision, builders_and_tests, |
| 719 master=None): | 719 master=None): |
| 720 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 720 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 721 (builders_and_tests, issue)) | 721 (builders_and_tests, issue)) |
| 722 | 722 |
| 723 def trigger_distributed_try_jobs( # pylint:disable=R0201 | 723 def trigger_distributed_try_jobs( # pylint:disable=R0201 |
| 724 self, issue, patchset, reason, clobber, revision, masters): | 724 self, issue, patchset, reason, clobber, revision, masters): |
| 725 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % | 725 logging.info('ReadOnlyRietveld: triggering try jobs %r for issue %d' % |
| 726 (masters, issue)) | 726 (masters, issue)) |
| OLD | NEW |