Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(175)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 6912052: Catch timeout errors in upload.py and retry

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by hinoka
Modified:
13 years, 1 month ago
Reviewers:
M-A Ruel, M-A
CC:
codereview-discuss_googlegroups.com
Visibility:
Public.
Started as: https://codereview.chromium.org/11446068/ Catching urllib2.URLError These sometimes occur when an intermediate proxy is overloaded, and is only an temporary issue. We want to catch these exceptions and retry uploading.

Patch Set 1 #

Total comments: 2
Created: 13 years, 1 month ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -0 lines) Patch
M third_party/upload.py View 2 chunks +13 lines, -0 lines 2 comments Download
Total messages: 2
|
hinoka
13 years, 1 month ago (2012年12月07日 21:35:41 UTC) #1
Sign in to reply to this message.
M-A
https://codereview.appspot.com/6912052/diff/1/third_party/upload.py File third_party/upload.py (right): https://codereview.appspot.com/6912052/diff/1/third_party/upload.py#newcode424 third_party/upload.py:424: elif e.reason == '[Errno 110] Connection timed out': I'm ...
13 years, 1 month ago (2012年12月10日 15:08:44 UTC) #2
https://codereview.appspot.com/6912052/diff/1/third_party/upload.py
File third_party/upload.py (right):
https://codereview.appspot.com/6912052/diff/1/third_party/upload.py#newcode424
third_party/upload.py:424: elif e.reason == '[Errno 110] Connection timed out':
I'm not sure the error code is portable.
So I'd prefer with
 elif 'Connection timed out' in e.reason:
but see my comment below.
https://codereview.appspot.com/6912052/diff/1/third_party/upload.py#newcode431
third_party/upload.py:431: raise e
"raise" is better than "raise e" since it re-raise the original exception.
That's what you did at line 423.
I don't think it's useful to have 3 condition blocks, you really only need one;
if 'Connection timed out' in e.reason and tries <= 3:
 # retry with backoff
 (...)
 continue
raise
that's it.
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /