diff --git a/CHANGES/6719.bugfix b/CHANGES/6719.bugfix new file mode 100644 index 00000000000..b42ccca255d --- /dev/null +++ b/CHANGES/6719.bugfix @@ -0,0 +1 @@ +Fix regression where ``asyncio.CancelledError`` occurs on client disconnection. diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py index 0e59928b245..5d2f947738a 100644 --- a/aiohttp/web_protocol.py +++ b/aiohttp/web_protocol.py @@ -311,8 +311,6 @@ def connection_lost(self, exc: Optional[BaseException]) -> None: exc = ConnectionResetError("Connection lost") self._current_request._cancel(exc) - if self._task_handler is not None: - self._task_handler.cancel() if self._waiter is not None: self._waiter.cancel()