From 633ab3ec6a04c20c2f128dba06ef4cc84a91ffc4 Mon Sep 17 00:00:00 2001 From: Joe Keen Date: Thu, 4 Feb 2016 13:18:49 -0700 Subject: [PATCH] Fix Kafka consumer commit If we don't specify the current set of partitions to the commit call the Kafka consumer object seems to issue a commit for all the partitions it has information on and not just the ones it is actively reading. This fix will allow it to only commit to the partitions that it is consuming from. Change-Id: Ifd5aa9c8fe4d83f804629f1a301a40556721d018 --- monasca_common/kafka/consumer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monasca_common/kafka/consumer.py b/monasca_common/kafka/consumer.py index 40ec3924..dfedda48 100644 --- a/monasca_common/kafka/consumer.py +++ b/monasca_common/kafka/consumer.py @@ -220,4 +220,4 @@ class KafkaConsumer(object): def commit(self): self._last_commit = datetime.datetime.now() - self._consumer.commit() + self._consumer.commit(partitions=self._partitions)