Skip to content

CancelledError #6719

@H--o-l

Description

@H--o-l

Describe the bug

Using the aiohttp web server, I struggle with asyncio.CancelledError() when a client disconnect for some time.
I shielded what needed to be but it has its limits.
Today I found this old PR:
#4080

It looks like my issue.
If I understand correctly asyncio.CancelledError() was fixed at the beginning of v3.7.0 (1th October 2019).
But I still have frequent asyncio.CancelledError() in my server.

I have investigated a bit more and I find another PR, at the end of v3.7.0 (just before v3.7.0b0 I think) that for me re-introduce the issue:
#4415

For me the wrong code is the following:

        if self._task_handler is not None:
            self._task_handler.cancel()

It was removed by #4080 (and with all the documentation regarding this issue) but re-introduced silently by #4415.

I'm clearly not an expert so I'm not sure of what I'm saying, but does it make sense for you?

To Reproduce

NA

Expected behavior

NA

Logs/tracebacks

NA

Python Version

3.10.4

aiohttp Version

3.8.1

multidict Version

5.1.0

yarl Version

1.6.3

OS

Fedora 35

Related component

Server

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

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