Skip to content

Conversation

@CtrlZvi
Copy link
Contributor

@CtrlZvi CtrlZvi commented May 25, 2018

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..
(cherry picked from commit 4151061)

Co-authored-by: CtrlZvi [email protected]

https://bugs.python.org/issue26819

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..
(cherry picked from commit 4151061)

Co-authored-by: CtrlZvi <[email protected]>
@bedevere-bot
Copy link

@asvetlov: Please replace # with GH- in the commit message next time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants