SIGN IN SIGN UP

bpo-26819: Prevent proactor double read on resume (#6921)

The proactor event loop has a race condition when reading with
pausing/resuming. `resume_reading()` unconditionally schedules the read
function to read from the current future. If `resume_reading()` was
called before the previously scheduled done callback fires, this results
in two attempts to get the data from the most recent read and an
assertion failure. This commit tracks whether or not `resume_reading`
needs to reschedule the callback to restart the loop, preventing a
second attempt to read the data.
C
CtrlZvi committed
4151061855b571bf8a7579daa7875b8e243057b9
Parent: f5e7b19
Committed by Andrew Svetlov <andrew.svetlov@gmail.com> on 5/20/2018, 10:21:10 AM