[issue21998] asyncio: a new self-pipe should be created in the child process after fork

STINNER Victor report at bugs.python.org
Wed Feb 4 23:16:22 CET 2015


STINNER Victor added the comment:

Attached at_fork.patch: detect fork and handle fork.

* Add _at_fork() method to asyncio.BaseEventLoop
* Add _detect_fork() method to asyncio.BaseEventLoop
* Add _at_fork() method to selectors.BaseSelector

I tried to minimize the number of calls to _detect_fork(): only when the self-pipe or the selector is used.

I only tried test2.py. More tests using two processes running two event loops should be done, and non-regression tests should be written.

The issue #22087 (multiprocessing) looks like a duplicate of this issue.

----------
Added file: http://bugs.python.org/file38016/at_fork.patch

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


More information about the Python-bugs-list mailing list