Author njs
Recipients achimnol, asvetlov, njs, terry.reedy, yselivanov, zkonge
Date 2020-07-19.10:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595153839.14.0.671858429538.issue41229@roundup.psfhosted.org>
In-reply-to
Content
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 task creates lots of async generator objects, but never returns to the main loop. So they're all queued up to be collected, but it can't actually happen until you perform a real async operation. For example, try adding 'await asyncio.sleep(1)` before the input() call so that the event loop has a chance to run, and you'll see that the objects are collected immediately.

So this is a bit tricky, but this is actually expected behavior, and falls under the general category of "don't block the event loop, it will break stuff".
History
Date User Action Args
2020-07-19 10:17:19njssetrecipients: + njs, terry.reedy, asvetlov, yselivanov, achimnol, zkonge
2020-07-19 10:17:19njssetmessageid: <1595153839.14.0.671858429538.issue41229@roundup.psfhosted.org>
2020-07-19 10:17:19njslinkissue41229 messages
2020-07-19 10:17:18njscreate