From 5add1ca27dbf84d1f6a211bfe3064bb058d02959 Mon Sep 17 00:00:00 2001 From: Vikram Patki 24489 Date: Fri, 11 Oct 2019 21:12:14 -0400 Subject: [PATCH] returning offsets from the call to get the offsets from the group coordinator --- aiokafka/consumer/fetcher.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aiokafka/consumer/fetcher.py b/aiokafka/consumer/fetcher.py index 1a022fb..ea9036e 100644 --- a/aiokafka/consumer/fetcher.py +++ b/aiokafka/consumer/fetcher.py @@ -876,6 +876,7 @@ async def _retrieve_offsets(self, timestamps, timeout_ms=float("inf")): timeout=None if remaining == float("inf") else remaining, loop=self._loop ) + return offsets except asyncio.TimeoutError: break except Errors.KafkaError as error: @@ -888,8 +889,6 @@ async def _retrieve_offsets(self, timestamps, timeout_ms=float("inf")): if remaining < self._retry_backoff: break await asyncio.sleep(self._retry_backoff, loop=self._loop) - else: - return offsets raise KafkaTimeoutError( "Failed to get offsets by times in %s ms" % timeout_ms)