diff options
author | Mahendra M <mahendra.m@gmail.com> | 2013-06-20 12:57:38 +0530 |
---|---|---|
committer | Mahendra M <mahendra.m@gmail.com> | 2013-06-20 12:57:38 +0530 |
commit | aec388474ee74607683daff3c8f74f4543d26e86 (patch) | |
tree | 889e20e2bf959fdd77e686c9380d79e7ac334a8d /kafka/client.py | |
parent | ab72da3db32556b04d45954da8cf6c462dc53434 (diff) | |
parent | 883eed1f8ce1af37c621ad6ec89dc993694fd29b (diff) | |
download | kafka-python-aec388474ee74607683daff3c8f74f4543d26e86.tar.gz |
Merge branch 'master' into partition
Diffstat (limited to 'kafka/client.py')
-rw-r--r-- | kafka/client.py | 5 |
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) |