[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2021-02-05 Thread Spencer Nelson
Spencer Nelson added the comment: Josh, > Making literally every await equivalent to: > > await asyncio.sleep(0) > > followed by the actual await (which is effectively what you're proposing when > you expect all await to be preemptible) means adding non-trivial o

[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2021-02-04 Thread Spencer Nelson
Spencer Nelson added the comment: Thanks for testing on more Python versions. Yes, adding asyncio.sleep(0) after each put is an effective workaround - it's certainly possible to manually yield like that. I just think that that's what asyncio.Queue.put ought to be doing - in fact,

[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2021-02-03 Thread Spencer Nelson
Change by Spencer Nelson : -- keywords: +patch pull_requests: +23243 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24433 ___ Python tracker <https://bugs.python.org/issu

[issue43119] asyncio.Queue.put never yields if the queue is unbounded

2021-02-03 Thread Spencer Nelson
New submission from Spencer Nelson : I am writing some software that reads records from a very large file (~hundreds of GB), putting them in an `asyncio.Queue` as it goes, and a chain of consumers handle each record and do stuff over the network. To my surprise, my program runs out of memory