Skip to content

gh-130141: clean up asyncio._SelectorTransport during __del__ #130142

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 1 commit into
base: main
Choose a base branch
from

Conversation

lunixbochs
Copy link
Contributor

@lunixbochs lunixbochs commented Feb 15, 2025

aligns the SelectorTransport __del__ implementation with force_close
also sets sock_fd to -1 when closing the socket so stale fds can't be
reused
@lunixbochs lunixbochs changed the title gh-130141: mark _SelectorTransport as closing during del gh-130141: clean up asyncio._SelectorTransport during __del__ Feb 19, 2025
self._sock = None

self._protocol = None
self._loop = None
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for setting loop to None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

self._loop._remove_writer(self._sock_fd)
self._conn_lost += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants