-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix Backup Topic Creation Retries and Interrupts #540
Merged
jjaakola-aiven
merged 1 commit into
main
from
fleshgrinder/backup-topic-creation-retries
Feb 15, 2023
Merged
Fix Backup Topic Creation Retries and Interrupts #540
jjaakola-aiven
merged 1 commit into
main
from
fleshgrinder/backup-topic-creation-retries
Feb 15, 2023
Conversation
This file contains 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
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 13, 2023 16:09
7e34e33
to
801e743
Compare
Deploying with Cloudflare Pages
|
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 14, 2023 08:41
801e743
to
f1342f0
Compare
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 14, 2023 11:53
f1342f0
to
6b11d77
Compare
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 14, 2023 12:42
6b11d77
to
a50bb45
Compare
aiven-anton
reviewed
Feb 14, 2023
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 14, 2023 13:49
a50bb45
to
7b6d323
Compare
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 15, 2023 10:41
7b6d323
to
34b90a0
Compare
The retry logic in the backup code for admin client and topic creation is flawed as it compares seconds to milliseconds. Instead of aborting after the desired 60 seconds it aborts after 60,000 seconds. The retry implementation itself has several other issues, most notable the fact that it swallows `BaseException`, and thus cannot be interrupted by the user when it enters the retry loop. Instead of trying to come up with an optimized retry logic or a generic solution that can be used across the board, I decided to add a well tested library that already provides this logic. This updates only the backup code. Other code might or might not have similar flaws. For instance, after this change there are still 11 `pylint: disable=bare-except` left in the `karapace` source directory.
Fleshgrinder
force-pushed
the
fleshgrinder/backup-topic-creation-retries
branch
from
February 15, 2023 11:11
34b90a0
to
676b3d8
Compare
jjaakola-aiven
approved these changes
Feb 15, 2023
jjaakola-aiven
deleted the
fleshgrinder/backup-topic-creation-retries
branch
February 15, 2023 14:11
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.
The retry logic in the backup code for admin client and topic creation is flawed as it compares seconds to milliseconds. Instead of aborting after the desired 60 seconds it aborts after 60,000 seconds. The retry implementation itself has several other issues, most notable the fact that it swallows
BaseException
, and thus cannot be interrupted by the user when it enters the retry loop.Instead of trying to come up with an optimized retry logic or a generic solution that can be used across the board, I decided to add a well tested library that already provides this logic.
I also useThis was reverted, because we have to use an older tenacity version that does not supporttimedelta
in favor of primitives for all durations, to avoid unit confusion.timedelta
.This updates only the backup code. Other code might or might not have similar flaws. For instance, after this change there are still 11
pylint: disable=bare-except
left in thekarapace
source directory.Requires #537 to be merged first, as it includes it and builds on top of it.