ShivsundarR commented on code in PR #19647:
URL: https://github.com/apache/kafka/pull/19647#discussion_r2075137637


##########
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:
   So I was trying to follow the pattern here when we ignore certain exceptions 
while unsubscribing - 
https://github.com/apache/kafka/blob/9a6e4f1dcc67df825b209defe0b3d09b8e2d8ff6/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java#L940.
   We propagate fatal errors and metadata errors to the application thread, 
probably that's why these 3 exceptions were used. I will check once if there 
are any other exceptions which could come, we should probably ignore those as 
well.
   



-- 
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

Reply via email to