Add a backoff and retry to S3 puts to help with Slow Down messages.#321
Add a backoff and retry to S3 puts to help with Slow Down messages.#321zerebubuth merged 4 commits intomasterfrom
Conversation
rmarianski
left a comment
There was a problem hiding this comment.
Are you sure that the retry will actually catch the exception? I think it won't end up working that way. Here's a simple example:
def retry():
for _ in range(3):
try:
print 'yielding'
yield
print 'break'
break
except Exception:
print 'caught exception'
else:
print 'else'
yield
for _ in retry():
raise Exception('foo')| yield | ||
| break | ||
|
|
||
| except Exception as e: |
There was a problem hiding this comment.
Interesting idea to use a generator, but I don't think that it'll actually catch the exception here and retry.
…ased code for backoff and retry.
Oooops. Wow, I hadn't realised that I just pushed a different, and sadly more complex, version in 2520055. Please could you have a look and let me know if you think that's better? |
iandees
left a comment
There was a problem hiding this comment.
Looks good -- it'd be nice to add a logger as mentioned but not required.
| reduced_redundancy=self.reduced_redundancy, | ||
| ) | ||
|
|
||
| @_backoff_and_retry(Exception) |
There was a problem hiding this comment.
It'd be nice if there was a logger we could pass in so we know when things retry rather than stuff just silently taking forever.
|
@iandees, @rmarianski does that look good with the logger threaded through? |
LGTM 👍 |
No description provided.