Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 20, 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]>
@miss-islington
Copy link
Contributor Author

@CtrlZvi and @asvetlov: Backport status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

Thanks!

@miss-islington miss-islington deleted the backport-4151061-3.7 branch May 20, 2018 10:57
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.

5 participants