Skip to content
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

Add exponential backoff for deletion failures. #1683

Merged
merged 1 commit into from
Mar 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion system_tests/logging_.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,18 @@ def setUp(self):
self.to_delete = []

def tearDown(self):
from gcloud.exceptions import NotFound
for doomed in self.to_delete:
doomed.delete()
backoff_intervals = [1, 2, 4, 8]
while True:
try:
doomed.delete()
break
except NotFound:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

if backoff_intervals:
time.sleep(backoff_intervals.pop(0))
else:
raise

@staticmethod
def _logger_name():
Expand Down