Skip to content

Commit

Permalink
Fix unintended cancellation of fetcher task (#1007)
Browse files Browse the repository at this point in the history
* Fix unintented cancellation of fetcher task

* Update aiokafka/consumer/fetcher.py

Co-authored-by: Denis Otkidach <denis.otkidach@gmail.com>

---------

Co-authored-by: Denis Otkidach <denis.otkidach@gmail.com>
  • Loading branch information
apmorton and ods authored May 12, 2024
1 parent c759664 commit 79c9bf5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aiokafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ def on_done(fut, self=self):
# cancellation
if not task.done():
task.cancel()
await task
with contextlib.suppress(asyncio.CancelledError):
await task
self._pending_tasks.clear()
self._records.clear()

Expand Down

0 comments on commit 79c9bf5

Please sign in to comment.