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

Creating topic of empty string puts broker in a bad state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6, 0.7
    • 0.8.0
    • None
    • None

    Description

      Using the Java client library, I accidentally published a message where the topic name was the empty string. This put the broker in a bad state where publishing became impossible, and the following exception was logged 10-20 times per second:

      2012-06-21 00:41:30,324 [kafka-processor-3] ERROR kafka.network.Processor - Closing socket for /127.0.0.1 because of er
      ror
      kafka.common.InvalidTopicException: topic name can't be empty
      at kafka.log.LogManager.getOrCreateLog(LogManager.scala:165)
      at kafka.server.KafkaRequestHandlers.kafka$server$KafkaRequestHandlers$$handleProducerRequest(KafkaRequestHandle
      rs.scala:75)
      at kafka.server.KafkaRequestHandlers.handleProducerRequest(KafkaRequestHandlers.scala:58)
      at kafka.server.KafkaRequestHandlers$$anonfun$handlerFor$1.apply(KafkaRequestHandlers.scala:43)
      at kafka.server.KafkaRequestHandlers$$anonfun$handlerFor$1.apply(KafkaRequestHandlers.scala:43)
      at kafka.network.Processor.handle(SocketServer.scala:289)
      at kafka.network.Processor.read(SocketServer.scala:312)
      at kafka.network.Processor.run(SocketServer.scala:207)
      at java.lang.Thread.run(Thread.java:679)

      Restarting Kafka did not help. I had to manually clear out the bad state in Zookeeper to resolve the problem.

      The broker should not accept a message that would put it in such a bad state.

      Attachments

        1. KAFKA-371-0.8-v2.patch
          11 kB
          Jay Kreps
        2. KAFKA-371-0.8.patch
          1 kB
          Jonathan Creasy
        3. KAFKA-371-0.7.1.patch
          1 kB
          Jonathan Creasy

        Activity

          People

            jkreps Jay Kreps
            martinkl Martin Kleppmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: