ShivsundarR commented on code in PR #18944: URL: https://github.com/apache/kafka/pull/18944#discussion_r1960241628
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java: ########## @@ -177,8 +177,14 @@ public PollResult poll(long currentTimeMs) { if (nodeAcksFromFetchMap != null) { acknowledgementsToSend = nodeAcksFromFetchMap.remove(tip); if (acknowledgementsToSend != null) { - metricsManager.recordAcknowledgementSent(acknowledgementsToSend.size()); - fetchAcknowledgementsInFlight.computeIfAbsent(node.id(), k -> new HashMap<>()).put(tip, acknowledgementsToSend); + if (handler.isNewSession()) { + // Failing the acknowledgements as we cannot have piggybacked acknowledgements in the initial ShareFetchRequest. + acknowledgementsToSend.complete(Errors.INVALID_SHARE_SESSION_EPOCH.exception()); + maybeSendShareAcknowledgeCommitCallbackEvent(Collections.singletonMap(tip, acknowledgementsToSend)); Review Comment: Okay, thanks. I have updated all the occurences of `Collections.singletonMap` to `Map.of` in the file. -- 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