Skip to content

Commit

Permalink
Fix consumer start() hanging after long idle (fixes #764) (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
ods committed Jul 13, 2021
1 parent 24a062d commit 724e810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES/764.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix consumer's `start()` method hanging after being idle for more than
`max_poll_interval_ms`
2 changes: 1 addition & 1 deletion aiokafka/consumer/group_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ async def ensure_active_group(self, subscription, prev_assignment):

# We will not attempt rejoin if there is no activity on consumer
idle_time = self._subscription.fetcher_idle_time
if idle_time >= self._max_poll_interval:
if prev_assignment is not None and idle_time >= self._max_poll_interval:
await asyncio.sleep(self._retry_backoff_ms / 1000)
return None

Expand Down

0 comments on commit 724e810

Please sign in to comment.