Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

AmqpProtocol worker should not swallow asyncio.CancelledError #157

Closed jkr78 closed 6 years ago

jkr78 commented 6 years ago

https://github.com/Polyconseil/aioamqp/blob/aa915ab2e89861899d6b39acc4475fb500867d00/aioamqp/protocol.py#L332-L340

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

jkr78 commented 6 years ago

sorry, this issue is duplicate of #133

remort commented 5 years ago

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().