summaryrefslogtreecommitdiff
path: root/kafka/client.py
diff options
context:
space:
mode:
authorMahendra M <mahendra.m@gmail.com>2013-06-25 12:42:22 +0530
committerMahendra M <mahendra.m@gmail.com>2013-06-25 12:42:22 +0530
commit119d4114f9ddb909b2147e75006da6ac13ad3ed8 (patch)
tree79f237efd502c10d618b40c68e7d56963c9130aa /kafka/client.py
parent28884c80f3cea53220c77a4b648488442e3900dd (diff)
parent883eed1f8ce1af37c621ad6ec89dc993694fd29b (diff)
downloadkafka-python-119d4114f9ddb909b2147e75006da6ac13ad3ed8.tar.gz
Merge branch 'master' into lazythread
Diffstat (limited to 'kafka/client.py')
-rw-r--r--kafka/client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py
index 5595d49..1146798 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -73,7 +73,12 @@ class KafkaClient(object):
self.brokers.update(brokers)
self.topics_to_brokers = {}
+
for topic, partitions in topics.items():
+ # Clear the list once before we add it. This removes stale entries
+ # and avoids duplicates
+ self.topic_partitions.pop(topic, None)
+
if not partitions:
log.info("Partition is unassigned, delay for 1s and retry")
time.sleep(1)