ShivsundarR commented on code in PR #19647: URL: https://github.com/apache/kafka/pull/19647#discussion_r2080076709
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java: ########## @@ -1017,8 +1017,12 @@ private void maybeThrowInvalidGroupIdException() { * <p> * If the acknowledgement commit callback throws an exception, this method will throw an exception. */ - private void handleCompletedAcknowledgements() { - processBackgroundEvents(); + private void handleCompletedAcknowledgements(boolean onClose) { + // If the user gets any fatal errors, they will get these exceptions in the background queue. + // While closing, we ignore these exceptions so that the consumers close successfully. + processBackgroundEvents(onClose ? e -> (e instanceof GroupAuthorizationException Review Comment: Thanks @lianetm for the context here, this really helps. Yes I did take a look at `handleTopicMetadata` in `KafkaApis`, I could not find any topic/auth related errors that we are missing. There could still be retriable errors received in the metadata response but those are not propagated to the application thread, so we need not add them here. The current checks seem to cover all the cases then. -- 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