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

feat: exponential backoff for launchpad retries #355

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

tigarmo
Copy link
Contributor

@tigarmo tigarmo commented May 31, 2024

Builds on top of #352, only the last commit is new.

This commit changes the retry() strategy: instead of sleeping a constant
3 seconds between attempts, each attempt sleeps twice as much as the previous
one (starting at 2 seconds). There is a cap of 5 attempts, so that the call
to retry can sleep() for at most 2+4+8+16+32 = 62 seconds.

tigarmo added 2 commits May 31, 2024 17:33
This only covers those calls that currently have a known Exception type.
@tigarmo tigarmo marked this pull request as ready for review May 31, 2024 20:40
@tigarmo tigarmo requested review from lengau and mr-cal May 31, 2024 20:40
craft_application/util/retry.py Outdated Show resolved Hide resolved
@tigarmo tigarmo force-pushed the CRAFT-2626-exponential-fallback branch from 2284e6e to 307c18f Compare June 3, 2024 12:55
This commit changes the retry() strategy: instead of sleeping a constant
3 seconds between attempts, each attempt sleeps twice as much as the previous
one (starting at 2 seconds). There is a cap of 5 attempts, so that the call
to retry can sleep() for at most 2+4+8+16+32 = 62 seconds.
@tigarmo tigarmo force-pushed the CRAFT-2626-exponential-fallback branch from 307c18f to 45a1df0 Compare June 3, 2024 14:05
@tigarmo tigarmo merged commit b97d76d into main Jun 3, 2024
6 checks passed
@tigarmo tigarmo deleted the CRAFT-2626-exponential-fallback branch June 3, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants