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

Do not attempt to del transport in connection_lost if it has been already #215

Merged
merged 1 commit into from
Aug 7, 2021
Merged
Changes from all 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
15 changes: 8 additions & 7 deletions edgedb/protocol/asyncio_proto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ cdef class AsyncIOProtocol(protocol.SansIOProtocol):
self.msg_waiter.set_exception(ConnectionResetError())
self.msg_waiter = None

# With asyncio sslproto on CPython 3.10 or lower, a normal exit
# (connection closed by peer) cannot set the transport._closed
# properly, leading to false ResourceWarning. Let's fix that by
# closing the transport again.
if not self.transport.is_closing():
self.transport.close()
self.transport = None
if self.transport is not None:
# With asyncio sslproto on CPython 3.10 or lower, a normal exit
# (connection closed by peer) cannot set the transport._closed
# properly, leading to false ResourceWarning. Let's fix that by
# closing the transport again.
if not self.transport.is_closing():
self.transport.close()
self.transport = None

def pause_writing(self):
pass
Expand Down