This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author twisteroid ambassador
Recipients asvetlov, twisteroid ambassador, yselivanov
Date 2018-10-01.15:33:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538407991.85.0.545547206417.issue34769@psf.upfronthosting.co.za>
In-reply-to
Content
I have finally managed to reproduce this one reliably. The issue happens when i) async generators are not finalized immediately and must be garbage collected in the future, and ii) the garbage collector happens to run in a different thread than the one running the event loop. (Obviously, if there are more than one Python threads, eventually gc will run in those other threads, causing problems.)

I have attached a script reproducing the problem. I tried several ways of using async generators (the use_agen_*() coroutines), and the only way to make them not finalize immediately is use_agen_anext_separate_tasks(), which is the pattern used in my Happy Eyeballs library.
History
Date User Action Args
2018-10-01 15:33:11twisteroid ambassadorsetrecipients: + twisteroid ambassador, asvetlov, yselivanov
2018-10-01 15:33:11twisteroid ambassadorsetmessageid: <1538407991.85.0.545547206417.issue34769@psf.upfronthosting.co.za>
2018-10-01 15:33:11twisteroid ambassadorlinkissue34769 messages
2018-10-01 15:33:11twisteroid ambassadorcreate