-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: aiohttp assert exception on connection lost (#406)
Problem: a bug in aiohttp causes an assertion error to appear in the logs whenever an HTTP connection is lost. Solution: there is no mainline fix in aiohttp. It is not trivial to install a forked version of aiohttp, so the simplest solution for now is to apply the aiohttp patch directly. Bumped aiohttp to 3.8.4 at the same time.
- Loading branch information
1 parent
9ee2a64
commit 7894232
Showing
3 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py | ||
index 10a96080..f103b167 100644 | ||
--- a/aiohttp/web_protocol.py | ||
+++ b/aiohttp/web_protocol.py | ||
@@ -299,6 +299,8 @@ class RequestHandler(BaseProtocol): | ||
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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters