https://github.com/python/cpython
Revision 749afe81ec0a4b92ad6b89a67c82f2c04f79c5ac authored by CtrlZvi on 25 May 2018, 08:03:25 UTC, committed by Andrew Svetlov on 25 May 2018, 08:03:25 UTC
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 4151061855b571bf8a7579daa7875b8e243057b9)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
1 parent 36f066a
History
Tip revision: 749afe81ec0a4b92ad6b89a67c82f2c04f79c5ac authored by CtrlZvi on 25 May 2018, 08:03:25 UTC
[3.6] bpo-26819: Prevent proactor double read on resume (GH-6921) (#7110)
Tip revision: 749afe8
File Mode Size
c-api
data
distributing
distutils
extending
faq
howto
includes
install
installing
library
reference
tools
tutorial
using
whatsnew
Makefile -rw-r--r-- 7.3 KB
README.rst -rw-r--r-- 4.3 KB
about.rst -rw-r--r-- 1.5 KB
bugs.rst -rw-r--r-- 4.2 KB
conf.py -rw-r--r-- 6.1 KB
contents.rst -rw-r--r-- 538 bytes
copyright.rst -rw-r--r-- 451 bytes
docutils.conf -rw-r--r-- 56 bytes
glossary.rst -rw-r--r-- 49.1 KB
license.rst -rw-r--r-- 46.2 KB
make.bat -rw-r--r-- 5.1 KB

README.rst

back to top