-
Notifications
You must be signed in to change notification settings - Fork 21
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
catch RequestLimitExceeded exceptions and do several retries with sle… #12
base: master
Are you sure you want to change the base?
Conversation
backup_monkey/core.py
Outdated
log.error("Encountered Error %s on volume %s", e.error_code, volume.id) | ||
break | ||
except boto.exception.BotoServerError, e: | ||
log.error("Encountered Error %s on volume %s, waiting %d seconds then retrying", e.error_code, volume.id, attempt) |
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.
Here is snapshot related, snapshot id in log should be better.
backup_monkey/core.py
Outdated
volume.create_snapshot(description) | ||
for attempt in range(5): | ||
try: | ||
volume.create_snapshot(description) |
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.
most of code and logic for snapshot and volume are same, I use a func wrapper to do it.
backup_monkey/core.py
Outdated
except boto.exception.BotoServerError, e: | ||
log.error("Encountered Error %s on volume %s, waiting %d seconds then retrying", e.error_code, volume.id, attempt) | ||
time.sleep(attempt) | ||
break |
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.
After sleep, it should not break but continue.
backup_monkey/core.py
Outdated
break | ||
else: | ||
log.error("Encountered Error %s on volume %s, %d retries failed, continuing", e.error_code, volume.id, attempt) | ||
continue |
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.
No need to put continue here.
…eps inbetween