Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unclosed transport warning #8875

Merged
merged 5 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions aiohttp/web_protocol.py
Dreamsorcerer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,12 @@ def connection_lost(self, exc: Optional[BaseException]) -> None:
return
self._manager.connection_lost(self, exc)

super().connection_lost(exc)
bdraco marked this conversation as resolved.
Show resolved Hide resolved

# Grab value before setting _manager to None.
handler_cancellation = self._manager.handler_cancellation

self.force_close()
super().connection_lost(exc)
self._manager = None
self._force_close = True
self._request_factory = None
self._request_handler = None
self._request_parser = None
Expand All @@ -349,9 +348,6 @@ def connection_lost(self, exc: Optional[BaseException]) -> None:
exc = ConnectionResetError("Connection lost")
self._current_request._cancel(exc)

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

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

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ addopts =
filterwarnings =
error
ignore:module 'ssl' has no attribute 'OP_NO_COMPRESSION'. The Python interpreter is compiled against OpenSSL < 1.0.0. Ref. https.//docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION:UserWarning
ignore:unclosed transport <asyncio.sslproto._SSLProtocolTransport object.*:ResourceWarning
ignore:unclosed transport <_ProactorSocketTransport closing fd=-1>:ResourceWarning
Dreamsorcerer marked this conversation as resolved.
Show resolved Hide resolved
ignore:Unclosed client session <aiohttp.client.ClientSession object at 0x:ResourceWarning
ignore:The loop argument is deprecated:DeprecationWarning:asyncio
Expand Down
Loading