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
.github
.vsts
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
.bzrignore -rw-r--r-- 582 bytes
.gitattributes -rw-r--r-- 798 bytes
.gitignore -rw-r--r-- 1.4 KB
.hgignore -rw-r--r-- 1.3 KB
.travis.yml -rw-r--r-- 4.9 KB
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 59.6 KB
README.rst -rw-r--r-- 9.2 KB
aclocal.m4 -rw-r--r-- 13.0 KB
config.guess -rwxr-xr-x 43.2 KB
config.sub -rwxr-xr-x 35.7 KB
configure -rwxr-xr-x 478.8 KB
configure.ac -rw-r--r-- 159.4 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 41.2 KB
setup.py -rw-r--r-- 102.1 KB

README.rst

back to top