ShivsundarR commented on code in PR #20247:
URL: https://github.com/apache/kafka/pull/20247#discussion_r2246054545


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -758,6 +758,16 @@ private void handleShareFetchSuccess(Node fetchTarget,
                 if (response.error() == Errors.UNKNOWN_TOPIC_ID) {
                     metadata.requestUpdate(false);
                 }
+                // Complete any inFlight acknowledgements with the error code 
from the response.
+                Map<TopicIdPartition, Acknowledgements> 
nodeAcknowledgementsInFlight = 
fetchAcknowledgementsInFlight.get(fetchTarget.id());
+                if (nodeAcknowledgementsInFlight != null) {
+                    nodeAcknowledgementsInFlight.forEach((tip, acks) -> {
+                        
acks.complete(Errors.forCode(response.error().code()).exception());
+                        
metricsManager.recordFailedAcknowledgements(acks.size());
+                        
maybeSendShareAcknowledgeCommitCallbackEvent(Map.of(tip, acks));

Review Comment:
   Thanks, yeah that makes sense. I have moved it outside the loop now.



-- 
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]

Reply via email to