-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
KAFKA-15562: ensure commit request manager handles errors correctly #14639
KAFKA-15562: ensure commit request manager handles errors correctly #14639
Conversation
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Show resolved
Hide resolved
Thanks @philipnee, I left some comments |
Hi @lucasbru - Thanks for taking the time to review my PR. I addressed all but 2 comments:
|
log.debug("Offset fetch failed: {}", responseError.message()); | ||
|
||
// TODO: should we retry on COORDINATOR_NOT_AVAILABLE as well ? | ||
if (responseError == Errors.COORDINATOR_LOAD_IN_PROGRESS) { |
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.
nit: merge first two branches now?
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java
Outdated
Show resolved
Hide resolved
Changes look good to me. Did I understand david correctly that we want to add more changes to this PR?
That was just "out of interest", since you are already using mockito to mock things, why not use it for the response object as well. But I realize that the object is a pretty plain data container, so the answer I guess is that it's easier.
That's not what I meant. I just found the flow I think the control flow may also lead to logging in a way that may not be intended? For fencing, we get one generic I imagined something like:
But I'm not super familiar with the code style in the new consumer, and consistency with the rest of the code and the old consumer is also important. So I just wanted to give this to you as an inspiration, but you are probably in the best position to come up with the best way to implement it. |
Hi @lucasbru - Thanks for the response. To your first question: Yes, what is left is correcting the error handling at the user API level. At the time I implemented this, I wrapped all errors in KafkaException (I forgot the reason why), however, we should throw the exact exception instead. So I will follow up with a second part PR to make this Jira issue completed. I get what you meant for |
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.
I think we're having duplicate logging now.
continue; | ||
} | ||
|
||
if (error.exception() instanceof RetriableException) { |
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.
I think you want to remove this if/else block completely now
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, as well as the error == Errors.NONE
@lucasbru - Thanks for taking time reviewing this PR. I addressed your previous comment. Let me know if there's anything unclear on this PR. |
wip Handle various of errors update error handler Update CommitRequestManager.java wip
Update CommitRequestManager.java
…e internal state.
72a6de9
to
91f44f6
Compare
trigger test
Test failures seem irrelevant, but retriggering the test as there's a failed build |
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. Thanks, @philipnee !
Test failures unrelated |
…pache#14639) The current commitRequestManager lacks logic handling various failures. In the patch I addressed the following gap: * Network disconnection should disconnect the coordinator node * Handling and testing various of fatal and retriable errors scenarios * Ensure the time returned in the poll results is Long.MAX or the minimum of all the inflight request's remainingBackoffMs. Because we need to respect the backoff. Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
…pache#14639) The current commitRequestManager lacks logic handling various failures. In the patch I addressed the following gap: * Network disconnection should disconnect the coordinator node * Handling and testing various of fatal and retriable errors scenarios * Ensure the time returned in the poll results is Long.MAX or the minimum of all the inflight request's remainingBackoffMs. Because we need to respect the backoff. Reviewer: Lucas Brutschy <lbrutschy@confluent.io>
The current commitRequestManager lacks logic handling various failures. In the patch I addressed the following gap: