-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry 400s during dataset teardown. #2333
Retry 400s during dataset teardown. #2333
Conversation
for doomed in self.to_delete: | ||
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.
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.
@tseaver Were you able to reproduce this locally? |
Not except by borking the delete of tables in the dataset. |
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #2318.