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

AdminClient should handle empty or null topic names better

    XMLWordPrintableJSON

    Details

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

      Description

      if you try to `createTopics(Collections.singleton(new NewTopic()));` you will get something like the following:

      [2018-01-02 11:20:46,481] ERROR [kafka-admin-client-thread | adminclient-3] Uncaught exception in thread 'kafka-admin-client-thread | adminclient-3': (org.apache.kafka.common.utils.KafkaThread)
      org.apache.kafka.common.protocol.types.SchemaException: Error computing size for field 'create_topic_requests': Error computing size for field 'topic': Missing value for field 'topic' which has no default value.
      	at org.apache.kafka.common.protocol.types.Schema.sizeOf(Schema.java:94)
      	at org.apache.kafka.common.protocol.types.Struct.sizeOf(Struct.java:341)
      	at org.apache.kafka.common.requests.AbstractRequestResponse.serialize(AbstractRequestResponse.java:28)
      	at org.apache.kafka.common.requests.AbstractRequest.serialize(AbstractRequest.java:98)
      	at org.apache.kafka.common.requests.AbstractRequest.toSend(AbstractRequest.java:91)
      	at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:423)
      	at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:397)
      	at org.apache.kafka.clients.NetworkClient.send(NetworkClient.java:358)
      	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:810)
      	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1002)
      	at java.lang.Thread.run(Thread.java:745)
      [2018-01-02 11:20:46,481] ERROR [kafka-admin-client-thread | adminclient-3] Uncaught exception in thread 'kafka-admin-client-thread | adminclient-3': (org.apache.kafka.common.utils.KafkaThread)
      org.apache.kafka.common.protocol.types.SchemaException: Error computing size for field 'create_topic_requests': Error computing size for field 'topic': Missing value for field 'topic' which has no default value.
      	at org.apache.kafka.common.protocol.types.Schema.sizeOf(Schema.java:94)
      	at org.apache.kafka.common.protocol.types.Struct.sizeOf(Struct.java:341)
      	at org.apache.kafka.common.requests.AbstractRequestResponse.serialize(AbstractRequestResponse.java:28)
      	at org.apache.kafka.common.requests.AbstractRequest.serialize(AbstractRequest.java:98)
      	at org.apache.kafka.common.requests.AbstractRequest.toSend(AbstractRequest.java:91)
      	at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:423)
      	at org.apache.kafka.clients.NetworkClient.doSend(NetworkClient.java:397)
      	at org.apache.kafka.clients.NetworkClient.send(NetworkClient.java:358)
      	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:810)
      	at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1002)
      	at java.lang.Thread.run(Thread.java:745)
      [2018-01-02 11:21:01,383] ERROR [qtp1875757262-59] Unhandled exception resulting in internal server error response (io.confluent.rest.exceptions.GenericExceptionMapper)
      java.util.concurrent.TimeoutException
      	at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:108)
      	at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:225)
      	at io.confluent.controlcenter.data.KafkaDao.createTopics(KafkaDao.java:85)
      	at io.confluent.controlcenter.rest.KafkaResource.createTopic(KafkaResource.java:87)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      

      the actual error prints immediately, but the adminclient still waits for a timeout and then exposes a TimeoutException to the user

      Note that no other elements of the batch request are performed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                norwood dan norwood
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: