[ https://issues.apache.org/jira/browse/KAFKA-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14309671#comment-14309671 ]
Guozhang Wang commented on KAFKA-1884: -------------------------------------- I think the behavior that producer's sender thread will keep retrying refreshing metadata for invalid topic names is expected, and it does not actually "block" the producer as it is a background thread; but the other issue is valid: it should back off between refreshing instead of bombarding the server. This issue is being addressed in KAFKA-1919. > New Producer blocks forever for Invalid topic names > --------------------------------------------------- > > Key: KAFKA-1884 > URL: https://issues.apache.org/jira/browse/KAFKA-1884 > Project: Kafka > Issue Type: Bug > Components: producer > Affects Versions: 0.8.2 > Reporter: Manikumar Reddy > Fix For: 0.8.3 > > > New producer blocks forever for invalid topics names > producer logs: > DEBUG [2015-01-20 12:46:13,406] NetworkClient: maybeUpdateMetadata(): Trying > to send metadata request to node -1 > DEBUG [2015-01-20 12:46:13,406] NetworkClient: maybeUpdateMetadata(): Sending > metadata request ClientRequest(expectResponse=true, payload=null, > request=RequestSend(header={api_key=3,api_version=0,correlation_id=50845,client_id=my-producer}, > body={topics=[TOPIC=]})) to node -1 > TRACE [2015-01-20 12:46:13,416] NetworkClient: handleMetadataResponse(): > Ignoring empty metadata response with correlation id 50845. > DEBUG [2015-01-20 12:46:13,417] NetworkClient: maybeUpdateMetadata(): Trying > to send metadata request to node -1 > DEBUG [2015-01-20 12:46:13,417] NetworkClient: maybeUpdateMetadata(): Sending > metadata request ClientRequest(expectResponse=true, payload=null, > request=RequestSend(header={api_key=3,api_version=0,correlation_id=50846,client_id=my-producer}, > body={topics=[TOPIC=]})) to node -1 > TRACE [2015-01-20 12:46:13,417] NetworkClient: handleMetadataResponse(): > Ignoring empty metadata response with correlation id 50846. > DEBUG [2015-01-20 12:46:13,417] NetworkClient: maybeUpdateMetadata(): Trying > to send metadata request to node -1 > DEBUG [2015-01-20 12:46:13,418] NetworkClient: maybeUpdateMetadata(): Sending > metadata request ClientRequest(expectResponse=true, payload=null, > request=RequestSend(header={api_key=3,api_version=0,correlation_id=50847,client_id=my-producer}, > body={topics=[TOPIC=]})) to node -1 > TRACE [2015-01-20 12:46:13,418] NetworkClient: handleMetadataResponse(): > Ignoring empty metadata response with correlation id 50847. > Broker logs: > [2015-01-20 12:46:14,074] ERROR [KafkaApi-0] error when handling request > Name: TopicMetadataRequest; Version: 0; CorrelationId: 51020; ClientId: > my-producer; Topics: TOPIC= (kafka.server.KafkaApis) > kafka.common.InvalidTopicException: topic name TOPIC= is illegal, contains a > character other than ASCII alphanumerics, '.', '_' and '-' > at kafka.common.Topic$.validate(Topic.scala:42) > at > kafka.admin.AdminUtils$.createOrUpdateTopicPartitionAssignmentPathInZK(AdminUtils.scala:186) > at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:177) > at kafka.server.KafkaApis$$anonfun$5.apply(KafkaApis.scala:367) > at kafka.server.KafkaApis$$anonfun$5.apply(KafkaApis.scala:350) > at > scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) > at > scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) > at scala.collection.immutable.Set$Set1.foreach(Set.scala:74) > at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) > at > scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47) > at scala.collection.SetLike$class.map(SetLike.scala:93) > at scala.collection.AbstractSet.map(Set.scala:47) > at kafka.server.KafkaApis.getTopicMetadata(KafkaApis.scala:350) > at > kafka.server.KafkaApis.handleTopicMetadataRequest(KafkaApis.scala:389) > at kafka.server.KafkaApis.handle(KafkaApis.scala:57) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:59) > at java.lang.Thread.run(Thread.java:722) -- This message was sent by Atlassian JIRA (v6.3.4#6332)