Author vstinner
Recipients asvetlov, pablogsal, vstinner, yselivanov
Date 2018-06-07.01:44:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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,
    """Transport for read pipes."""
    def pause_reading(self):
        if self._closing or self._paused:
        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 = 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:49vstinnersetrecipients: + vstinner, asvetlov, yselivanov, pablogsal
2018-06-07 01:44:49vstinnersetmessageid: <>
2018-06-07 01:44:49vstinnerlinkissue33694 messages
2018-06-07 01:44:48vstinnercreate