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

Add cancellation exception handler #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

progovoy
Copy link

@progovoy progovoy commented Dec 4, 2016

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.

This commit handles a proper close of the connection with MQ broker on
an outside cancelation of the future
@progovoy progovoy changed the title Add calncellation exception handler Add cancellation exception handler Dec 4, 2016
@hellysmile
Copy link

hellysmile commented Dec 8, 2016

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

@progovoy
Copy link
Author

progovoy commented Dec 8, 2016

So you say we should re-raise the cancel exception after cleanup?

@hellysmile
Copy link

hellysmile commented Dec 8, 2016

@progovoy it is up to @Polyconseil, and I am guessing to catch in same way with re-raise asyncio.Timeout

@progovoy
Copy link
Author

progovoy commented Dec 8, 2016

ok so @Polyconseil, please let us know how to proceed. I can add the re-raise or you do. Thank you Victor!

@progovoy
Copy link
Author

@hellysmile How should we proceed?

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

Successfully merging this pull request may close these issues.

2 participants