Skip to content

Revise cancellation of futures #87

@lgrahl

Description

@lgrahl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions