Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmqpProtocol worker should not swallow asyncio.CancelledError #157

Closed
jkr78 opened this issue Jan 4, 2018 · 2 comments
Closed

AmqpProtocol worker should not swallow asyncio.CancelledError #157

jkr78 opened this issue Jan 4, 2018 · 2 comments

Comments

@jkr78
Copy link

jkr78 commented Jan 4, 2018

aioamqp/aioamqp/protocol.py

Lines 332 to 340 in aa915ab

try:
yield from self.dispatch_frame()
except exceptions.AmqpClosedConnection as exc:
logger.info("Close connection")
self.stop_now.set_result(None)
self._close_channels(exception=exc)
except Exception: # pylint: disable=broad-except
logger.exception('error on dispatch')

As it is now it swallows asyncio.CanceledError and it is not possible to .cancel() the task.

@jkr78
Copy link
Author

jkr78 commented Jan 4, 2018

sorry, this issue is duplicate of #133

@dzen dzen closed this as completed Jun 28, 2018
@remort
Copy link

remort commented Apr 29, 2019

Reopen it please, 133 is closed but the problem is still here.
I got:

ERROR:aioamqp.protocol:error on dispatch
Traceback (most recent call last):
  File "/home/remort/.local/share/virtualenvs/whiteboard-server-RT9QNbYR/lib/python3.7/site-packages/aioamqp/protocol.py", line 333, in run
    yield from self.dispatch_frame()
  File "/home/remort/.local/share/virtualenvs/whiteboard-server-RT9QNbYR/lib/python3.7/site-packages/aioamqp/protocol.py", line 280, in dispatch_frame
    frame = yield from self.get_frame()
  File "/home/remort/.local/share/virtualenvs/whiteboard-server-RT9QNbYR/lib/python3.7/site-packages/aioamqp/protocol.py", line 264, in get_frame
    yield from frame.read_frame()
  File "/home/remort/.local/share/virtualenvs/whiteboard-server-RT9QNbYR/lib/python3.7/site-packages/aioamqp/frame.py", line 453, in read_frame
    data = yield from self.reader.readexactly(7)
  File "/usr/lib/python3.7/asyncio/streams.py", line 679, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data
    await self._waiter
concurrent.futures._base.CancelledError

While trying to await protocol.close() or await channel.basic_cancel().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants