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 ability to retry admin client calls on retriable exceptions #788

Merged

Conversation

apurvam
Copy link
Contributor

@apurvam apurvam commented Feb 24, 2018

This Fixes #786. See that issue for the context of the problem.

This patch introduces a RetryHelper class to the KafkaTopicClientImpl 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.

@apurvam apurvam requested a review from a team February 24, 2018 06:20
@apurvam apurvam changed the base branch from master to 4.1.x February 24, 2018 06:24
Copy link
Contributor

@dguy dguy left a 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retries != 0 ?

@apurvam apurvam force-pushed the 786-add-retry-to-kafka-topic-client branch from 740976d to 062c172 Compare February 26, 2018 19:33
Copy link
Contributor

@rodesai rodesai left a 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 "
Copy link
Contributor

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

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.

None yet

3 participants