Raise UnknownTopicOrPartitionError immediately in ensure_topic_exists -- server is not auto-creating

This commit is contained in:
Dana Powers
2014-09-01 16:41:18 -07:00
parent 90c6520097
commit b260b356b2

View File

@@ -257,6 +257,10 @@ class KafkaClient(object):
self.load_metadata_for_topics(topic)
except LeaderNotAvailableError:
pass
except UnknownTopicOrPartitionError:
# Server is not configured to auto-create
# retrying in this case will not help
raise
time.sleep(.5)
def load_metadata_for_topics(self, *topics):