summaryrefslogtreecommitdiff
path: root/kafka/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/client.py')
-rw-r--r--kafka/client.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py
index 9893737..eb2c25c 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -65,6 +65,12 @@ class KafkaClient(object):
self.brokers.update(brokers)
self.topics_to_brokers = {}
for topic, partitions in topics.items():
+ if not partitions:
+ log.info("Partition is unassigned, delay for 1s and retry")
+ time.sleep(1)
+ self._load_metadata_for_topics(topic)
+ break
+
for partition, meta in partitions.items():
if meta.leader == -1:
log.info("Partition is unassigned, delay for 1s and retry")