New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncio : ProactorEventLoop raised BlockingIOError when ThreadPoolExecutor has many workers #68034
Comments
I tested on python3.4.2, windows 7
BlockingIOError: [WinError 10035] A non-blocking socket operation could not be completed immediately.
exception calling callback for <Future at 0x1ab89ef0 state=finished returned NoneType>
Traceback (most recent call last):
File "c:\Python342\Lib\concurrent\futures\_base.py", line 297, in _invoke_callbacks
callback(self)
File "c:\Python342\Lib\asyncio\futures.py", line 410, in <lambda>
new_future._copy_state, fut))
File "c:\Python342\Lib\asyncio\base_events.py", line 403, in call_soon_threadsafe
self._write_to_self()
File "c:\Python342\Lib\asyncio\proactor_events.py", line 449, in _write_to_self
self._csock.send(b'\0') I guess that proactor's _write_to_self method misses exception handle. proactor_events.py selector_events.py Ps: It's my first publication. Hope you understand my poor comment.. |
Why are you using 20000 threads? --Guido (mobile)
|
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') |
I fixed the issue. Thanks for your bug report ;-) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: