]> granicus.if.org Git - python/commit
bpo-33694: Fix race condition in asyncio proactor (GH-7498)
authorVictor Stinner <vstinner@redhat.com>
Thu, 7 Jun 2018 22:25:52 +0000 (00:25 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Jun 2018 22:25:52 +0000 (00:25 +0200)
commit79790bc35fe722a49977b52647f9b5fe1deda2b7
treeb1b3da290ccfb7055c94e937cd1edc0282bf7a38
parentd3ed67d14ed401dfe2b5d07b6941adc3ecacb268
bpo-33694: Fix race condition in asyncio proactor (GH-7498)

The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.
Lib/asyncio/proactor_events.py
Lib/asyncio/protocols.py
Lib/asyncio/sslproto.py
Lib/test/test_asyncio/test_proactor_events.py
Lib/test/test_asyncio/test_sslproto.py
Misc/NEWS.d/next/Library/2018-06-07-23-51-00.bpo-33694.F1zIR1.rst [new file with mode: 0644]