-
Notifications
You must be signed in to change notification settings - Fork 1k
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 ability to retry admin client calls on retriable exceptions #788
Add ability to retry admin client calls on retriable exceptions #788
Conversation
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.
Thanks @apurvam, just one minor comment otherwise LGTM
int retries = 0; | ||
while (retries < NUM_RETRIES) { | ||
try { | ||
if (0 < retries) { |
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.
retries != 0
?
740976d
to
062c172
Compare
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. Left one comment inline.
} | ||
} | ||
throw new ExecutionException( | ||
new RuntimeException("Could not complete admin operation even after " |
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.
It might be good to keep a copy of the last exception and pass it in as a cause here
This Fixes #786. See that issue for the context of the problem.
This patch introduces a
RetryHelper
class to theKafkaTopicClientImpl
which allows transparent retires of admin client calls when there are retriable exceptions. We should be retrying on these exceptions to have a robust implementation of the topic client.