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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -471,17 +471,18 @@ public CompletableFuture<Map<TopicIdPartition, 
Acknowledgements>> commitSync(
                 // Add the incoming commitSync() request to the queue.
                 Map<TopicIdPartition, Acknowledgements> 
acknowledgementsMapForNode = new HashMap<>();
                 for (TopicIdPartition tip : 
sessionHandler.sessionPartitions()) {
-                    Acknowledgements acknowledgements = 
acknowledgementsMap.get(tip);
-                    if (acknowledgements != null) {
-                        acknowledgementsMapForNode.put(tip, acknowledgements);
+                    NodeAcknowledgements acknowledgements = 
acknowledgementsMap.get(tip);
+                    if ((acknowledgements != null) && 
(acknowledgements.nodeId() == node.id())) {

Review Comment:
   Here, should we add a null check for the actual `Acknowledgements` class 
inside NodeAcknowledgements.
   Although ideally as we already have a null check for NodeAcknowledgements, 
the case shouldn't ever arise. Just for it be consistent with other parts of 
the code.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to