aioamqp
aioamqp copied to clipboard
Add cancellation exception handler
This commit handles a proper close of the connection with MQ broker on an outside cancellation of the future. For instance when calling cancel on all of the loop's gathered futures on program termination, the library would just raise an exception.
Hello there, I was experiencing some kind of similar issues, as for me if library catches asycnio.CancelledError
it needs to do internal cleanup and raise again asycnio.CancelledError
, otherwise it will incorrect behavio for all nested coroutines. Right now I am using asyncio.shield
for any aioamqp channel methods, cuz cancellation of them breaks all actually
So you say we should re-raise the cancel exception after cleanup?
@progovoy it is up to @Polyconseil, and I am guessing to catch in same way with re-raise asyncio.Timeout
ok so @Polyconseil, please let us know how to proceed. I can add the re-raise or you do. Thank you Victor!
@hellysmile How should we proceed?