[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13548673#comment-13548673 ] Neha Narkhede commented on KAFKA-690: - The protocol was meant to do this, so checked it on 0.8 branch. > TopicMetadataRequest throws exception when no topics are specified > -- > > Key: KAFKA-690 > URL: https://issues.apache.org/jira/browse/KAFKA-690 > Project: Kafka > Issue Type: Bug > Components: core >Affects Versions: 0.8 >Reporter: David Arthur > Fix For: 0.8 > > Attachments: KAFKA-690.patch > > > 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.(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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13548638#comment-13548638 ] Jay Kreps commented on KAFKA-690: - +1 Thanks David! Folks, objections to putting this on 0.8? > TopicMetadataRequest throws exception when no topics are specified > -- > > Key: KAFKA-690 > URL: https://issues.apache.org/jira/browse/KAFKA-690 > Project: Kafka > Issue Type: Bug > Components: core >Affects Versions: 0.8 >Reporter: David Arthur > Fix For: 0.8 > > Attachments: KAFKA-690.patch > > > 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.(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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13548522#comment-13548522 ] David Arthur commented on KAFKA-690: Ah, I didn't see that JIRA. I was following https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-MetadataRequest and read "TopicName -> The topics to produce metadata for. If empty the request will yield metadata for all topics", so I assumed this was a bug instead of a TODO > TopicMetadataRequest throws exception when no topics are specified > -- > > Key: KAFKA-690 > URL: https://issues.apache.org/jira/browse/KAFKA-690 > Project: Kafka > Issue Type: Bug > Components: core >Affects Versions: 0.8 >Reporter: David Arthur > Fix For: 0.8 > > Attachments: KAFKA-690.patch > > > 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.(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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13548436#comment-13548436 ] Maxime Brugidou commented on KAFKA-690: --- this would resolve KAFKA-653 > TopicMetadataRequest throws exception when no topics are specified > -- > > Key: KAFKA-690 > URL: https://issues.apache.org/jira/browse/KAFKA-690 > Project: Kafka > Issue Type: Bug > Components: core >Affects Versions: 0.8 >Reporter: David Arthur > Fix For: 0.8 > > Attachments: KAFKA-690.patch > > > 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.(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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13547665#comment-13547665 ] Neha Narkhede commented on KAFKA-690: - +1. Thanks for the patch ! > TopicMetadataRequest throws exception when no topics are specified > -- > > Key: KAFKA-690 > URL: https://issues.apache.org/jira/browse/KAFKA-690 > Project: Kafka > Issue Type: Bug > Components: core >Affects Versions: 0.8 >Reporter: David Arthur > Fix For: 0.8 > > Attachments: KAFKA-690.patch > > > 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.(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) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (KAFKA-690) TopicMetadataRequest throws exception when no topics are specified
[ https://issues.apache.org/jira/browse/KAFKA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13547494#comment-13547494 ] David Arthur commented on KAFKA-690: Removing the debug statement fixes the issue. However, it seems instead of returning all of the topic metadata - I get none. Here are some trace logs when I send a TopicMetadataRequest with no topics [2013-01-08 19:53:34,463] TRACE 26 bytes read from /127.0.0.1:61558 (kafka.network.Processor) [2013-01-08 19:53:34,465] TRACE Received request: TopicMetadataRequest(0,kafka-python,List(),0) (kafka.network.RequestChannel$) [2013-01-08 19:53:34,466] TRACE Recieved request, sending for processing by handler: Request(1,sun.nio.ch.SelectionKeyImpl@785e8d7d,java.nio.HeapByteBuffer[pos=0 lim=26 cap=26],1357692814463) (kafka.network.Processor) [2013-01-08 19:53:34,466] DEBUG [Kafka Request Handler 1 on Broker 0], handles request Request(1,sun.nio.ch.SelectionKeyImpl@785e8d7d,java.nio.HeapByteBuffer[pos=0 lim=26 cap=26],1357692814463) (kafka.server.KafkaRequestHandler) [2013-01-08 19:53:34,466] TRACE Handling topic metadata request TopicMetadataRequest(0,kafka-python,List(),0) (kafka.request.logger) [2013-01-08 19:53:34,466] TRACE [KafkaApi-0] Handling topic metadata request TopicMetadataRequest(0,kafka-python,List(),0) (kafka.server.KafkaApis) [2013-01-08 19:53:34,475] TRACE Socket server received response to send, registering for write: Response(1,Request(1,sun.nio.ch.SelectionKeyImpl@785e8d7d,java.nio.HeapByteBuffer[pos=0 lim=26 cap=26],1357692814463),kafka.network.BoundedByteBufferSend@2e82674b) (kafka.network.Processor) [2013-01-08 19:53:34,476] TRACE 16 bytes written to /127.0.0.1:61558 (kafka.network.Processor) [2013-01-08 19:53:34,476] TRACE Completed request: TopicMetadataRequest(0,kafka-python,List(),0) totalTime:13 queueTime:3 localTime:9 remoteTime:0 sendTime:1 (kafka.network.RequestChannel$) I would expect this to return info about the one existing topic "test". Here are the logs for when I send a TopicMetadataRequest with the "test" topic (this gives the expected response): [2013-01-08 19:55:26,247] TRACE 32 bytes read from /127.0.0.1:61719 (kafka.network.Processor) [2013-01-08 19:55:26,247] TRACE Received request: TopicMetadataRequest(0,kafka-python,List(test),0) (kafka.network.RequestChannel$) [2013-01-08 19:55:26,247] TRACE Recieved request, sending for processing by handler: Request(0,sun.nio.ch.SelectionKeyImpl@30d647d8,java.nio.HeapByteBuffer[pos=0 lim=32 cap=32],1357692926247) (kafka.network.Processor) [2013-01-08 19:55:26,247] DEBUG [Kafka Request Handler 0 on Broker 0], handles request Request(0,sun.nio.ch.SelectionKeyImpl@30d647d8,java.nio.HeapByteBuffer[pos=0 lim=32 cap=32],1357692926247) (kafka.server.KafkaRequestHandler) [2013-01-08 19:55:26,247] TRACE Handling topic metadata request TopicMetadataRequest(0,kafka-python,List(test),0) (kafka.request.logger) [2013-01-08 19:55:26,247] TRACE [KafkaApi-0] Handling topic metadata request TopicMetadataRequest(0,kafka-python,List(test),0) (kafka.server.KafkaApis) [2013-01-08 19:55:26,248] DEBUG Reading reply sessionid:0x13c15a1d848003f, packet:: clientPath:null serverPath:null finished:false header:: 30,3 replyHeader:: 30,354,0 request:: '/kafka/brokers/topics/test,F response:: s{320,320,1357689749289,1357689749289,0,1,0,0,14,1,323} (org.apache.zookeeper.ClientCnxn) [2013-01-08 19:55:26,249] DEBUG Reading reply sessionid:0x13c15a1d848003f, packet:: clientPath:null serverPath:null finished:false header:: 31,4 replyHeader:: 31,354,0 request:: '/kafka/brokers/topics/test,F response:: #7b202230223a205b2230225d207d,s{320,320,1357689749289,1357689749289,0,1,0,0,14,1,323} (org.apache.zookeeper.ClientCnxn) [2013-01-08 19:55:26,252] DEBUG Partition map for /brokers/topics/test is Map(0 -> List(0)) (kafka.utils.ZkUtils$) [2013-01-08 19:55:26,255] DEBUG Reading reply sessionid:0x13c15a1d848003f, packet:: clientPath:null serverPath:null finished:false header:: 32,4 replyHeader:: 32,354,0 request:: '/kafka/brokers/topics/test/partitions/0/leaderAndISR,F response:: #7b2022495352223a2230222c226c6561646572223a2230222c22636f6e74726f6c6c657245706f6368223a223c226c656164657245706f6368223a223022207d,s{325,325,1357689749406,1357689749406,0,0,0,0,66,0,325} (org.apache.zookeeper.ClientCnxn) [2013-01-08 19:55:26,266] DEBUG Reading reply sessionid:0x13c15a1d848003f, packet:: clientPath:null serverPath:null finished:false header:: 33,4 replyHeader:: 33,354,0 request:: '/kafka/brokers/topics/test/partitions/0/leaderAndISR,F response:: #7b2022495352223a2230222c226c6561646572223a2230222c22636f6e74726f6c6c657245706f6368223a223c226c656164657245706f6368223a223022207d,s{325,325,1357689749406,1357689749406,0,0,0,0,66,0,325} (org.apache.zookeeper.ClientCnxn) [2013-01-08 19:55:26,277] DEBUG replicas = List(0), in sync replicas = ArrayBuffer(0), leader = Some(0) (k