Message318874
Sorry, the patch to reproduce the issue on Linux is wrong: it introduces a bug in the test. Ignore this comment.
--
It seems like I found the root cause: pause_reading() / resume_reading() on the transport is not safe. Sometimes, we loose data. See the "TODO" below...
class _ProactorReadPipeTransport(_ProactorBasePipeTransport,
transports.ReadTransport):
"""Transport for read pipes."""
(...)
def pause_reading(self):
if self._closing or self._paused:
return
self._paused = True
if self._read_fut is not None and not self._read_fut.done():
# TODO: This is an ugly hack to cancel the current read future
# *and* avoid potential race conditions, as read cancellation
# goes through `future.cancel()` and `loop.call_soon()`.
# We then use this special attribute in the reader callback to
# exit *immediately* without doing any cleanup/rescheduling.
self._read_fut.__asyncio_cancelled_on_pause__ = True
self._read_fut.cancel()
self._read_fut = None
self._reschedule_on_resume = True
if self._loop.get_debug():
logger.debug("%r pauses reading", self)
If you remove the "ugly hack", the test no longer hangs... |
|
Date |
User |
Action |
Args |
2018-06-07 01:44:49 | vstinner | set | recipients:
+ vstinner, asvetlov, yselivanov, pablogsal |
2018-06-07 01:44:49 | vstinner | set | messageid: <1528335889.29.0.592728768989.issue33694@psf.upfronthosting.co.za> |
2018-06-07 01:44:49 | vstinner | link | issue33694 messages |
2018-06-07 01:44:48 | vstinner | create | |
|