[issue41229] Asynchronous generator memory leak

2020-11-09 Thread Joongi Kim
Change by Joongi Kim : -- pull_requests: +22115 pull_request: https://github.com/python/cpython/pull/23217 ___ Python tracker ___

[issue41229] Asynchronous generator memory leak

2020-11-02 Thread miss-islington
miss-islington added the comment: New changeset 6e8dcdaaa49d4313bf9fab9f9923ca5828fbb10e by Joongi Kim in branch 'master': bpo-41229: Update docs for explicit aclose()-required cases and add contextlib.aclosing() method (GH-21545)

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim
Change by Joongi Kim : -- nosy: +Joongi Kim nosy_count: 6.0 -> 7.0 pull_requests: +20687 pull_request: https://github.com/python/cpython/pull/21545 ___ Python tracker ___

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith
Nathaniel Smith added the comment: Oh! I see it. This is actually working as intended. What's happening is that the event loop will clean up async generators when they're garbage collected... but, this requires that the event loop get a chance to run. In the demonstration program, the main

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith
Nathaniel Smith added the comment: ...On closer examination, it looks like that Trio PR has at least one test that checks that async generators are collected promptly after they stop being referenced, and that test passes:

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith
Nathaniel Smith added the comment: Huh, this is very weird. I can confirm that the async generator objects aren't cleaned up until loop shutdown on asyncio. On the trio main branch, we don't yet use the `set_asyncgen_hooks` mechanism, and the async generator objects are cleaned up

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim
Change by Joongi Kim : -- nosy: +njs ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim
Joongi Kim added the comment: I've searched the Python documentation and the docs must be updated to explicitly state the necessity of aclose(). refs) https://docs.python.org/3/reference/expressions.html#asynchronous-generator-functions https://www.python.org/dev/peps/pep-0525/ I'm not sure

[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim
Joongi Kim added the comment: >From the given example, if I add "await q.aclose()" after "await >q.asend(123456)" it does not leak the memory. This is a good example showing that we should always wrap async generators with explicit "aclosing" context manager (which does not exist yet in the

[issue41229] Asynchronous generator memory leak

2020-07-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Only 3.8+ for bug fixes. -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list

[issue41229] Asynchronous generator memory leak

2020-07-10 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41229] Asynchronous generator memory leak

2020-07-07 Thread JIanqiu Tao
New submission from JIanqiu Tao : The resource used by asynchronous generator can't be released properly when works with "asend" method. Besides, in Python 3.7-, a RuntimeError was raised when asyncio.run complete, but the message is puzzling: RuntimeError: can't send non-None value to a