Uh oh!
There was an error while loading. Please reload this page.
Playing with retries. - #2040
Conversation
| from functools import wraps | ||
| def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
daspecster
commented
Aug 1, 2016
Sorry, I should have put more in the description I think. So my point with this, was that there are a lot more errors after the main blocking bigquery error that we keep seeing. I'm sure this isn't the best solution. When I run system-tests I get a bunch of datastore failures/errors. Are there some fixtures I need to setup to get those to work? I can fix this up so we can merge and go from there though. |
dhermes
commented
Aug 1, 2016
There is nothing wrong with the retry method, it just looks copy-pasted. You'd probably rather use it inside the test case than on the test case: deftest_case_for_thing(self):
# do some set-up@retry(...)defthing_that_is_eventually_consistent():
global_object.some_method(args)
thing_that_is_eventually_consistent() |
067e147 to
2dc08cfComparedaspecster
commented
Aug 1, 2016
@dhermes LMKWYT. |
| @retry(Forbidden, tries=3, delay=30) | ||
| def update_dataset(): | ||
| dataset.update() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Aug 1, 2016
Thanks for taking the initiative here. Searching In particular, we should discuss this in #1619 |
| # We should try and keep `delay` and tries as low as possible to | ||
| # reduce test running time. tries=3 and delay=30 worked consistenly | ||
| # when updating a dataset. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
daspecster
commented
Aug 2, 2016
@dhermes here's the class version of the retry decorator. LMWYT. |
| exception = None | ||
| tries = None | ||
| delay = None | ||
| backoff = None |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| time.sleep(self.delay) | ||
| tries_counter -= 1 | ||
| self.delay *= self.backoff |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
874cf22 to
c532444Compare| # We need to wait for the changes in the dataset to propgate and be | ||
| # eventually consistent. The alternative outcome is a 403 Forbidden | ||
| # response from upstream. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
090b734 to
f33b2eaCompare| tries_counter = self.tries | ||
| exception = self.exception | ||
| delay = self.delay | ||
| backoff = self.backoff |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Aug 2, 2016
LGTM pending Travis |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
So I was playing with getting the retries working on the bigquery system3 tests.
I'm not sure what fixtures need to be created to get all the tests passing but this seemed to get the bigquery tests to pass.
Also, I have the retry set pretty long, looks like it takes about an average of 20 seconds for it to eventually be consistent.