aio-libs / aiokafka

asyncio client for kafka
http://aiokafka.readthedocs.io/
Apache License 2.0
1.08k stars 224 forks source link

asyncio.exceptions.CancelledError #974

Open spff opened 5 months ago

spff commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

Traceback (most recent call last):
  File "venv/lib/python3.9/site-packages/aiokafka/util.py", line 41, in wait_for
    return await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.9/site-packages/aiokafka/client.py", line 505, in send
    result = await future
  File "venv/lib/python3.9/site-packages/aiokafka/util.py", line 41, in wait_for
    return await fut
  File "venv/lib/python3.9/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "venv/lib/python3.9/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.9/site-packages/aiokafka/consumer/fetcher.py", line 660, in _proc_fetch_request
    response = await self._client.send(node_id, request)
  File "venv/lib/python3.9/site-packages/aiokafka/client.py", line 510, in send
    raise RequestTimedOutError()
aiokafka.errors.RequestTimedOutError: [Error 7] RequestTimedOutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.9/site-packages/aiokafka/consumer/fetcher.py", line 663, in _proc_fetch_request
    await asyncio.sleep(self._retry_backoff)
  File "/usr/lib/python3.9/asyncio/tasks.py", line 652, in sleep
    return await future
asyncio.exceptions.CancelledError

I'm wondering if we can ignore this type of exceptions https://github.com/aio-libs/aiokafka/blob/master/aiokafka/consumer/fetcher.py#L458 as the treatment here https://github.com/aio-libs/aiokafka/blob/master/aiokafka/consumer/fetcher.py#L450

Environment (please complete the following information):