Skip to content

gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess #134508

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented May 22, 2025

When the event loop is already closed, skip calling closing the pipe as it would otherwise lead to calling connection_lost callbacks which would error out of loop being closed.
See issue for detailed analysis.

@kumaraditya303 kumaraditya303 requested a review from gvanrossum May 22, 2025 14:41
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, one nit.

@@ -104,7 +104,12 @@ def close(self):
for proto in self._pipes.values():
if proto is None:
continue
proto.pipe.close()
# See https://github.com/python/cpython/issues/114177
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a gh-NNNNN reference is enough.

Suggested change
# See https://github.com/python/cpython/issues/114177
# See gh-114177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants