This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients dan.oreilly, gvanrossum, miss-islington, pitrou, thehesiod, yselivanov, zmedico
Date 2018-05-29.23:43:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527637395.52.0.682650639539.issue22087@psf.upfronthosting.co.za>
In-reply-to
Content
Even though I committed a version of Dan's patch to 3.7 and 3.8, I've finally decided to revert it and do it properly instead.  We should strive to implement a proper solution, not commit some half-working code.

A concrete plan (for Python 3.8 probably):

1. Fix BaseDefaultEventLoopPolicy to track PID in its 'get_event_loop()' and 'set_event_loop()' methods.  If a PID has changed since the last invocation: reset its internal local state.

2. Fix _UnixDefaultEventLoopPolicy to check for PID change in 'get_child_watcher()' and 'set_child_watcher()'.

3. Fix child watcher / event loops to track PID changes too to avoid listening for child processes of their parent process.

4. Look at how libuv and other event loops implement fork support. Ideally we should be able to shutdown selectors (epoll, kqueue) in forked processes in such a way that their parent process isn't affected.

5. Think how we can make 'asyncio.run' fork friendly. Ideally it should initialize its own child watcher and remove it when its done.
History
Date User Action Args
2018-05-29 23:43:15yselivanovsetrecipients: + yselivanov, gvanrossum, pitrou, zmedico, thehesiod, dan.oreilly, miss-islington
2018-05-29 23:43:15yselivanovsetmessageid: <1527637395.52.0.682650639539.issue22087@psf.upfronthosting.co.za>
2018-05-29 23:43:15yselivanovlinkissue22087 messages
2018-05-29 23:43:15yselivanovcreate