ShivsundarR commented on code in PR #16727:
URL: https://github.com/apache/kafka/pull/16727#discussion_r1709359480
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -518,33 +612,48 @@ private void handleShareAcknowledgeSuccess(Node
fetchTarget,
if (!handler.handleResponse(response, requestVersion)) {
acknowledgeRequestState.onFailedAttempt(currentTimeMs);
- if (response.error().exception() instanceof RetriableException
&& !closing) {
+ if (response.error().exception() instanceof RetriableException
&& !acknowledgeRequestState.onClose) {
// We retry the request until the timer expires, unless we
are closing.
+ acknowledgeRequestState.retryRequest();
} else {
- requestData.topics().forEach(topic ->
topic.partitions().forEach(partition -> {
- TopicIdPartition tip = new
TopicIdPartition(topic.topicId(),
- partition.partitionIndex(),
- metadata.topicNames().get(topic.topicId()));
-
metricsManager.recordFailedAcknowledgements(acknowledgeRequestState.getAcknowledgementsCount(tip));
+
response.data().responses().forEach(shareAcknowledgeTopicResponse ->
shareAcknowledgeTopicResponse.partitions().forEach(partitionData -> {
+ TopicIdPartition tip = new
TopicIdPartition(shareAcknowledgeTopicResponse.topicId(),
+ partitionData.partitionIndex(),
+
metadata.topicNames().get(shareAcknowledgeTopicResponse.topicId()));
+
acknowledgeRequestState.handleAcknowledgeErrorCode(tip, response.error());
+ metricsManager.recordLatency(resp.requestLatencyMs());
}));
-
- acknowledgeRequestState.processingComplete();
}
} else {
- response.data().responses().forEach(topic ->
topic.partitions().forEach(partition -> {
- TopicIdPartition tip = new
TopicIdPartition(topic.topicId(),
- partition.partitionIndex(),
- metadata.topicNames().get(topic.topicId()));
- if (partition.errorCode() != Errors.NONE.code()) {
-
metricsManager.recordFailedAcknowledgements(acknowledgeRequestState.getAcknowledgementsCount(tip));
+ AtomicBoolean shouldRetry = new AtomicBoolean(false);
Review Comment:
I had it made it `AtomicBoolean` as we are trying to modify it inside a
lambda expression. It did not allow `boolean`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]