[ https://issues.apache.org/jira/browse/KAFKA-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15129355#comment-15129355 ]
Jason Gustafson commented on KAFKA-3177: ---------------------------------------- [~guozhang] I think it's useful to separate failures into two categories: 1) ephemeral failures which should eventually resolve themselves, and 2) permanent failures. Blocking seems justifiable (even if undesirable) for ephemeral failures, but we ought to raise an exception if we don't expect the error to resolve "soon." I'd classify this type of failure as permanent since we can't really depend on the number of partitions being increased. And it almost certainly indicates a bug in the user's code if they're trying to assign partitions which don't exist. I think we'll have to handle cases like this individually as they come up. > Kafka consumer can hang when position() is called on a non-existing partition. > ------------------------------------------------------------------------------ > > Key: KAFKA-3177 > URL: https://issues.apache.org/jira/browse/KAFKA-3177 > Project: Kafka > Issue Type: Bug > Components: clients > Affects Versions: 0.9.0.0 > Reporter: Jiangjie Qin > Assignee: Jiangjie Qin > Fix For: 0.9.0.1 > > > This can be easily reproduced as following: > {code} > { > ... > consumer.assign(SomeNonExsitingTopicParition); > consumer.position(); > ... > } > {code} > It seems when position is called we will try to do the following: > 1. Fetch committed offsets. > 2. If there is no committed offsets, try to reset offset using reset > strategy. in sendListOffsetRequest(), if the consumer does not know the > TopicPartition, it will refresh its metadata and retry. In this case, because > the partition does not exist, we fall in to the infinite loop of refreshing > topic metadata. > Another orthogonal issue is that if the topic in the above code piece does > not exist, position() call will actually create the topic due to the fact > that currently topic metadata request could automatically create the topic. > This is a known separate issue. -- This message was sent by Atlassian JIRA (v6.3.4#6332)