Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7496

KafkaAdminClient#describeAcls should handle invalid filters gracefully

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: admin
    • Labels:
      None

      Description

      KafkaAdminClient#describeAcls should handle invalid filters gracefully. Specifically, it should return a future which yields an exception.

      The following code results in an uncaught IllegalArgumentException in the admin client thread, resulting in a zombie admin client.

      AclBindingFilter aclFilter = new AclBindingFilter(
          new ResourcePatternFilter(ResourceType.UNKNOWN, null, PatternType.ANY),
          AccessControlEntryFilter.ANY
      );
      kafkaAdminClient.describeAcls(aclFilter).values().get();
      

      See the resulting stacktrace below

      ERROR [kafka-admin-client-thread | adminclient-3] Uncaught exception in thread 'kafka-admin-client-thread | adminclient-3': (org.apache.kafka.common.utils.KafkaThread)
      java.lang.IllegalArgumentException: Filter contain UNKNOWN elements
          at org.apache.kafka.common.requests.DescribeAclsRequest.validate(DescribeAclsRequest.java:140)
          at org.apache.kafka.common.requests.DescribeAclsRequest.<init>(DescribeAclsRequest.java:92)
          at org.apache.kafka.common.requests.DescribeAclsRequest$Builder.build(DescribeAclsRequest.java:77)
          at org.apache.kafka.common.requests.DescribeAclsRequest$Builder.build(DescribeAclsRequest.java:67)
          at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:450)
          at org.apache.kafka.clients.NetworkClient.send(NetworkClient.java:411)
          at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:910)
          at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1107)
          at java.base/java.lang.Thread.run(Thread.java:844)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cmccabe Colin P. McCabe
                Reporter:
                cmccabe Colin P. McCabe
                Reviewer:
                Rajini Sivaram
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: