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

Leak in asyncio.selector_events._SelectorSocketTransport #87745

Closed
begnac mannequin opened this issue Mar 21, 2021 · 5 comments
Closed

Leak in asyncio.selector_events._SelectorSocketTransport #87745

begnac mannequin opened this issue Mar 21, 2021 · 5 comments
Labels
3.12 bugs and security fixes performance Performance or resource usage topic-asyncio

Comments

@begnac
Copy link
Mannequin

begnac mannequin commented Mar 21, 2021

BPO 43579
Nosy @asvetlov, @1st1, @begnac

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-03-21.07:11:10.990>
labels = ['expert-asyncio', '3.9', '3.10', 'performance']
title = 'Leak in asyncio.selector_events._SelectorSocketTransport'
updated_at = <Date 2021-03-21.07:11:10.990>
user = 'https://github.com/begnac'

bugs.python.org fields:

activity = <Date 2021-03-21.07:11:10.990>
actor = 'begnac'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['asyncio']
creation = <Date 2021-03-21.07:11:10.990>
creator = 'begnac'
dependencies = []
files = []
hgrepos = []
issue_num = 43579
keywords = []
message_count = 1.0
messages = ['389219']
nosy_count = 3.0
nosy_names = ['asvetlov', 'yselivanov', 'begnac']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue43579'
versions = ['Python 3.9', 'Python 3.10']

@begnac
Copy link
Mannequin Author

begnac mannequin commented Mar 21, 2021

Hello,

Even after close()ing, asyncio.selector_events._SelectorSocketTransport keeps a reference to itself via self._read_ready_cb.

should probably add

def close(self):
    super().close()
    self._read_ready_cb = None

Cheers !
Itaï.

@begnac begnac mannequin added 3.9 only security fixes 3.10 only security fixes topic-asyncio performance Performance or resource usage labels Mar 21, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@ezio-melotti ezio-melotti moved this to Todo in asyncio Jul 17, 2022
@iritkatriel iritkatriel added 3.12 bugs and security fixes and removed 3.10 only security fixes 3.9 only security fixes labels Aug 25, 2022
@kumaraditya303
Copy link
Contributor

The gc would break the cycle anyways, is this an issue in practice? @begnac

@kumaraditya303 kumaraditya303 added the pending The issue will be closed if no feedback is provided label Sep 24, 2022
@begnac
Copy link

begnac commented Sep 26, 2022

In my experience, the gc doesn't always break all the cycles.
Personally I like to check for cycles in my code and clean them up, just in case. Sometimes I stumble over cycles in code I use. Specifically about this one, it's been such a long time I do not remember... but if I found it, it's because something didn't get cleaned up :)

@gvanrossum
Copy link
Member

I think it's a reasonable suggestion and the fix should be simple.

@kumaraditya303 kumaraditya303 removed the pending The issue will be closed if no feedback is provided label Oct 2, 2022
@kumaraditya303
Copy link
Contributor

Duplicate of #100348

@kumaraditya303 kumaraditya303 marked this as a duplicate of #100348 Dec 20, 2022
@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
Repository owner moved this from Todo to Done in asyncio Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes performance Performance or resource usage topic-asyncio
Projects
Status: Done
Development

No branches or pull requests

4 participants