Retry 400s during dataset teardown.#2333
Merged
tseaver merged 2 commits intogoogleapis:masterfrom Sep 16, 2016
tseaver:2318-bigquery-dataset-still-in-use
Merged
Retry 400s during dataset teardown.#2333tseaver merged 2 commits intogoogleapis:masterfrom tseaver:2318-bigquery-dataset-still-in-use
tseaver merged 2 commits intogoogleapis:masterfrom
tseaver:2318-bigquery-dataset-still-in-use
Conversation
dhermes
reviewed
Sep 16, 2016
system_tests/bigquery.py
Outdated
| if isinstance(doomed, Bucket): | ||
| retry = RetryErrors(Conflict) | ||
| retry(doomed.delete)(force=True) | ||
| retry_409 = RetryErrors(Conflict) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
dhermes
reviewed
Sep 16, 2016
system_tests/bigquery.py
Outdated
| retry_409(doomed.delete)(force=True) | ||
| else: | ||
| doomed.delete() | ||
| retry_400(doomed.delete)() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Contributor
|
@tseaver Were you able to reproduce this locally? |
Contributor
Author
Not except by borking the delete of tables in the dataset. |
Contributor
|
Gotcher. Thanks for the tip. Can you add an error predicate, e.g. def err_pred(exc):
return (len(exc._errors) == 1 and
exc._errors[0]['reason'] == 'resourceInUse')Here is the output from catching that error: >>> try:
... dataset.delete()
... except Exception as exc:
... pass
...
>>> import json
>>> print(json.dumps(exc.__dict__, indent=2))
{
"message": "Dataset {PROJ}:create_table{TESTID} is still in use (DELETE https://www.googleapis.com/bigquery/v2/projects/{PROJ}/datasets/create_table{TESTID})",
"_errors": [
{
"domain": "global",
"message": "Dataset {PROJ}:create_table{TESTID} is still in use",
"reason": "resourceInUse"
}
]
} |
Addresses: #2333 (comment)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2318.