AndrewJSchofield commented on code in PR #18672: URL: https://github.com/apache/kafka/pull/18672#discussion_r1934133395
########## 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: I will rename the variable `acknowledgements` to `nodeAcknowledgements` to make it a bit clearer to read. I don't believe that `nodeAcknowledgements.acknowledgements()` can be null because the empty case is `Acknowledgements.empty()` and the fetching code in the application thread only sends the acks to be processed if they are non-empty. I can put a null check in the constructor for `NodeAcknowledgements`. -- 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