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

Revise cancellation of futures #87

Open
lgrahl opened this issue Aug 30, 2018 · 0 comments
Open

Revise cancellation of futures #87

lgrahl opened this issue Aug 30, 2018 · 0 comments
Labels

Comments

@lgrahl
Copy link
Member

lgrahl commented Aug 30, 2018

Cancellation is propagated if not handled/shielded.

For example, when cancelling a Server.wait_closed, the handler tasks one is waiting for will be cancelled. We should carefully examine the public API and prevent futures from cancellation which shouldn't be cancelled.

Edit: This also affects the internal API. And coroutines are often moved into tasks, so we basically have to look at every yield from. An alternative to add tons of asyncio.shield is to mark a specific internal coroutine/task/future as don't cancel unless you really want to exit now. Candidates for this are, among others, ServerProtocol.handler and ServerProtocol.handle_client.

Edit 2: Wow, this issue sounds more scary than it actually is. Don't worry. The only critical operations affected here are enqueues into the task queue. But since the queue is unlimited, it will never block at the moment.

@lgrahl lgrahl added the bug label Aug 30, 2018
@lgrahl lgrahl changed the title Cancellation of public futures has side effects Revise cancellation of futures Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant