Kafka
  1. Kafka
  2. KAFKA-690

TopicMetadataRequest throws exception when no topics are specified

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: core
    • Labels:
      None

      Description

      If no topics are sent in a TopicMetadataRequest, `readFrom` throws an exception when trying to get the the head of the topic list for a debug statement.

      java.util.NoSuchElementException: head of empty list
      at scala.collection.immutable.Nil$.head(List.scala:386)
      at scala.collection.immutable.Nil$.head(List.scala:383)
      at kafka.api.TopicMetadataRequest$$anonfun$readFrom$2.apply(TopicMetadataRequest.scala:43)
      at kafka.api.TopicMetadataRequest$$anonfun$readFrom$2.apply(TopicMetadataRequest.scala:43)
      at kafka.utils.Logging$class.debug(Logging.scala:51)
      at kafka.api.TopicMetadataRequest$.debug(TopicMetadataRequest.scala:25)
      at kafka.api.TopicMetadataRequest$.readFrom(TopicMetadataRequest.scala:43)
      at kafka.api.RequestKeys$$anonfun$4.apply(RequestKeys.scala:37)
      at kafka.api.RequestKeys$$anonfun$4.apply(RequestKeys.scala:37)
      at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:47)
      at kafka.network.Processor.read(SocketServer.scala:320)
      at kafka.network.Processor.run(SocketServer.scala:231)
      at java.lang.Thread.run(Thread.java:680)

      1. KAFKA-690.patch
        5 kB
        David Arthur

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              David Arthur
              Reporter:
              David Arthur
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development