Skip to content

Commit

Permalink
KAFKA-18813: [3/N] Client support for TopicAuthException in DescribeC…
Browse files Browse the repository at this point in the history
…onsumerGroup path (#18996)

Reviewers: David Jacot <[email protected]>
  • Loading branch information
lianetm authored Feb 21, 2025
1 parent f543eac commit c580874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ private void handleError(

switch (error) {
case GROUP_AUTHORIZATION_FAILED:
case TOPIC_AUTHORIZATION_FAILED:
log.debug("`{}` request for group id {} failed due to error {}.", apiName, groupId.idValue, error);
// The topic auth response received on DescribeConsumerGroup is a generic one not including topic names, so we just pass it on unchanged here.
failed.put(groupId, error.exception(errorMsg));
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.kafka.common.errors.GroupAuthorizationException;
import org.apache.kafka.common.errors.GroupIdNotFoundException;
import org.apache.kafka.common.errors.InvalidGroupIdException;
import org.apache.kafka.common.errors.TopicAuthorizationException;
import org.apache.kafka.common.errors.UnsupportedVersionException;
import org.apache.kafka.common.message.ConsumerGroupDescribeRequestData;
import org.apache.kafka.common.message.ConsumerGroupDescribeResponseData;
Expand Down Expand Up @@ -321,6 +322,7 @@ public void testRetriableHandleConsumerGroupResponse() {
@Test
public void testFailedHandleConsumerGroupResponse() {
assertFailed(GroupAuthorizationException.class, handleConsumerGroupWithError(Errors.GROUP_AUTHORIZATION_FAILED));
assertFailed(TopicAuthorizationException.class, handleConsumerGroupWithError(Errors.TOPIC_AUTHORIZATION_FAILED));
assertFailed(InvalidGroupIdException.class, handleConsumerGroupWithError(Errors.INVALID_GROUP_ID));
}

Expand Down

0 comments on commit c580874

Please sign in to comment.