[issue23846] asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers

Yury Selivanov report at bugs.python.org
Tue Dec 22 18:18:47 EST 2015


Yury Selivanov added the comment:

> Why are you using 20000 threads?

That's a good question.

In any case it looks like self-pipe sock's buffer was overflown because call_soon_threadsafe was called too many times, and loop._read_from_self couldn't empty the buffer promptly.  Then, at some point, _write_to_self failed with an IOError.

It looks like this was fixed for the selector loop, but not for proactor:

selector_events.py:

    def _write_to_self(self):
        csock = self._csock
        if csock is not None:
            try:
                csock.send(b'\0')
            except OSError:
                if self._debug:
                    logger.debug("Fail to write a null byte into the "
                                 "self-pipe socket",
                                 exc_info=True)

proactor_events.py:

    def _write_to_self(self):
        self._csock.send(b'\0')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23846>
_______________________________________


More information about the Python-bugs-list mailing list