Mirai1129 commented on code in PR #19914: URL: https://github.com/apache/kafka/pull/19914#discussion_r2203214845
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java: ########## @@ -178,6 +178,23 @@ public CommitRequestManager( */ @Override public NetworkClientDelegate.PollResult poll(final long currentTimeMs) { + if (coordinatorRequestManager.coordinator().isEmpty() && closing) { + CommitFailedException exception = new CommitFailedException( + "Failed to commit offsets: Coordinator unknown and consumer is closing"); + + List<NetworkClientDelegate.UnsentRequest> pendingCommits = pendingRequests.drainPendingCommits(); + + // Complete each commit request exceptionally + pendingCommits.forEach(request -> { + if (request.future() != null) { + request.future().completeExceptionally(exception); + } Review Comment: Thanks for the ref, I see. I'll fix it right 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org