diff options
author | Dana Powers <dana.powers@gmail.com> | 2018-03-08 08:18:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 08:18:15 -0800 |
commit | 4abdb1baea2468408c36cc983dfef1e8b8f54654 (patch) | |
tree | 423abefa3ffd7b42d819a472a29e820731693e22 | |
parent | b33a65116ef6936183f09ca56930ccae39378c5f (diff) | |
download | kafka-python-4abdb1baea2468408c36cc983dfef1e8b8f54654.tar.gz |
Avoid tight poll loop in consumer when brokers are down (#1415)
-rw-r--r-- | kafka/consumer/group.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 110df55..f6f1a67 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -1059,7 +1059,7 @@ class KafkaConsumer(six.Iterator): poll_ms = 1000 * (self._consumer_timeout - time.time()) if not self._fetcher.in_flight_fetches(): - poll_ms = 0 + poll_ms = min(poll_ms, self.config['reconnect_backoff_ms']) self._client.poll(timeout_ms=poll_ms) # after the long poll, we should check whether the group needs to rebalance |