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 esrse
Recipients asvetlov, esrse, josh.r, yselivanov
Date 2019-11-22.06:43:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574405028.72.0.244646997372.issue38874@roundup.psfhosted.org>
In-reply-to
Content
Thanks for having an interest in this issue.

I thought asyncio.Queue guarantees the order of items as .put called after I
read the code. But it does not.

I attach poc code here.
In my machine, this program prints this message and exits.
$ python poc-oooput.py
num=1, last_read_num=0
num=33, last_read_num=1
Traceback (most recent call last):
  File "poc-oooput.py", line 47, in <module>
    asyncio.run(main())
  File "/home/esrse/.pyenv/versions/3.7.3/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/home/esrse/.pyenv/versions/3.7.3/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "poc-oooput.py", line 44, in main
    await stream.read()
  File "poc-oooput.py", line 20, in read
    assert num == self._last_read_num + 1
AssertionError

This shows you that the 33rd item is put before the 2nd item.
History
Date User Action Args
2019-11-22 06:43:48esrsesetrecipients: + esrse, asvetlov, yselivanov, josh.r
2019-11-22 06:43:48esrsesetmessageid: <1574405028.72.0.244646997372.issue38874@roundup.psfhosted.org>
2019-11-22 06:43:48esrselinkissue38874 messages
2019-11-22 06:43:48esrsecreate