[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset af9cda9845666e2f704177a431d29f91efbf828a by Yury Selivanov in 
branch '3.7':
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" 
(GH-7233)
https://github.com/python/cpython/commit/af9cda9845666e2f704177a431d29f91efbf828a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 99279ad823a758288e4e41962abfc4dad8943ce8 by Yury Selivanov in 
branch 'master':
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (#7232)
https://github.com/python/cpython/commit/99279ad823a758288e4e41962abfc4dad8943ce8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6865

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6864

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

another related issue: https://bugs.python.org/issue33688

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6858

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 2a7eb0b531656f4a77d85078e6e009e4b3639ef9 by Miss Islington (bot) 
in branch '3.7':
bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)
https://github.com/python/cpython/commit/2a7eb0b531656f4a77d85078e6e009e4b3639ef9


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6851

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +6847

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 5d97b7bcc19496617bf8c448d2f149cc28c73bc7 by Yury Selivanov in 
branch 'master':
bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)
https://github.com/python/cpython/commit/5d97b7bcc19496617bf8c448d2f149cc28c73bc7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +6843
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2018-03-11 Thread Zac Medico

Change by Zac Medico :


--
nosy: +zmedico

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2017-06-28 Thread Yury Selivanov

Yury Selivanov added the comment:

> It seems there's a check in the top-level get_event_loop() function but not 
> in the DefaultEventLoopPolicy.get_event_loop() method.

Yes, as users aren't supposed to work with policies directly.

> (also: wow, that stuff is complicated)

Yep. Please assign me to review if you submit a PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2017-06-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It seems there's a check in the top-level get_event_loop() function but not in 
the DefaultEventLoopPolicy.get_event_loop() method.

(also: wow, that stuff is complicated)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2017-06-28 Thread Yury Selivanov

Yury Selivanov added the comment:

> The approach in Dan's patches looks sane to me and I agree the issue needs 
> fixing.  Dan, would you like to submit a PR for this?  We're using Github for 
> patch submissions now.


Mind that the patch is very outdated and we already have these checks in 
get_event_loop.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2017-06-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The approach in Dan's patches looks sane to me and I agree the issue needs 
fixing.  Dan, would you like to submit a PR for this?  We're using Github for 
patch submissions now.

--
nosy: +pitrou
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2017-02-21 Thread Alexander Mohr

Alexander Mohr added the comment:

I believe this is now worse due to https://github.com/python/asyncio/pull/452

before I was able to simply create a new run loop from sub-processes however 
you will now get the error "Cannot run the event loop while another loop is 
running".  The state of the run loop should not be preserved in sub-processes 
either.

--
nosy: +thehesiod
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork=)

2015-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
title: asyncio: support multiprocessing -> asyncio: support multiprocessing 
(support fork=)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22087] asyncio: support multiprocessing (support fork)

2015-02-15 Thread STINNER Victor

Changes by STINNER Victor :


--
title: asyncio: support multiprocessing (support fork=) -> asyncio: support 
multiprocessing (support fork)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com