bpo-33694: Fix race condition on proactor recv() by vstinner · Pull Request #7498 · python/cpython (original) (raw)

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.

https://bugs.python.org/issue33694