[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

Марк Коренберг report at bugs.python.org
Mon Jul 24 11:11:01 EDT 2017


Марк Коренберг added the comment:

Triggered almost the same error. Minimal proof:

Documentation did not say that .drain() can't be called simultaneously.

===================================
async def do_nothing(client_reader, client_writer):
    await asyncio.sleep(10000)

mb = b'*' * (4096*4)
async def write_cmd(writer):
    writer.write(mb)
    await writer.drain()

async def amain():
    srv = await asyncio.start_unix_server(do_nothing, b'\x00qwe')
    (reader, writer) = await asyncio.open_unix_connection(b'\x00qwe')
    await asyncio.gather(*(write_cmd(writer) for i in range(200)))

loop = asyncio.get_event_loop()
loop.run_until_complete(amain())
===================================

----------
nosy: +socketpair

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29930>
_______________________________________


More information about the Python-bugs-list mailing list