Skip to content

Change web handlers cancellation policy #2492

@asvetlov

Description

@asvetlov

Cancelling a web handler task on client disconnection is the most unexpected and annoying feature of aiohttp web server.
People from classic WSGI world don't expect it.
Moreover tornado doesn't support a cancellation (I hope it will in 5.0 release).

The proposal is:

  • web-handler cancellation should be opt-in, not opt-out (by aiojobs and async_armor usage).
  • Application should have allow_cancel constructor parameter, False by default.
  • Any record in application route table should accept allow_cancel to override the default.

Opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions