gh-98703: Fix asyncio proactor_events calling _call_connection_lost multiple times (GH-98704)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
Ken Jin 2022-10-27 10:37:12 +08:00 committed by GitHub
parent 7b24333fff
commit 8a755423eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -152,6 +152,8 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin,
self._loop.call_soon(self._call_connection_lost, exc)
def _call_connection_lost(self, exc):
if self._called_connection_lost:
return
try:
self._protocol.connection_lost(exc)
finally: