AndrewJSchofield commented on code in PR #20247: URL: https://github.com/apache/kafka/pull/20247#discussion_r2245606882
########## 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: I think that `nodeAcknowledgementsInFlight` is already the correct type for you just to call `maybeSendShareAcknowledgeCommitCallbackEvent(nodeAcknowledgementsInFlight)` outside the loop. -- 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