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

Prevent commitSync to bubble up exception to control thread where no exception is caught. #816

Closed
wants to merge 2 commits into from

Conversation

wushilin
Copy link
Contributor

Moved commitSync to a while loop to attempt to commit forever. As soon as brokers are online again, commit will succeed and consumption can resume.

Checklist

  • Documentation (if applicable)
  • Changelog

@wushilin wushilin requested a review from a team as a code owner July 25, 2024 12:39
Copy link

cla-assistant bot commented Jul 25, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

consumer.commitSync(offsetsToSend);
// break when offset commit is okay. Do not throw exception to main threads
break;
} catch(Throwable t) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to explicitly specify the exceptions that are retriable? You wouldn't want to be stuck in a commit loop if the call has no chance of ever succeeding.

@rkolesnev
Copy link
Contributor

@wushilin - can you have a look at #818 - i know it is solving this problem in a different manner from your suggested approach - but i think it may fix it for your use case as well - and i am in favour of it to be honest.
Closing this PR.

@rkolesnev rkolesnev closed this Aug 12, 2024
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