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 kj
Recipients asvetlov, kj, spenczar, yselivanov
Date 2021-02-04.09:11:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612429918.79.0.204982706852.issue43119@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the minimal reproducer. I've tested it on 3.9.0 and 3.10a4 and they seem to exhibit the same behavior too.

Out of genuine curiosity (I don't mean to question if this *is* a bug, it seems like a trap for users): why not place an ``await asyncio.sleep(0)`` after ``queue.put`` line to force a switch in the producer? Eg, from your example code, instead of :
        while True:
            await q.put(i)

maybe this:
        while True:
            await q.put(i)
            await asyncio.sleep(0)
With that workaround, your example starts printing each item and the consumer tasks don't seem to get blocked.
History
Date User Action Args
2021-02-04 09:11:58kjsetrecipients: + kj, asvetlov, yselivanov, spenczar
2021-02-04 09:11:58kjsetmessageid: <1612429918.79.0.204982706852.issue43119@roundup.psfhosted.org>
2021-02-04 09:11:58kjlinkissue43119 messages
2021-02-04 09:11:57kjcreate