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 Elvis.Pranskevichus
Recipients Elvis.Pranskevichus, yselivanov
Date 2017-07-19.22:49:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500504575.06.0.700406850987.issue30972@psf.upfronthosting.co.za>
In-reply-to
Content
The attached example shows that `asyncio.get_event_loop` still returns parent process' event loop in some cases.  It appears that the fix in issue #29703 was incomplete:

PARENT PID: 21947, LOOP: <_UnixSelectorEventLoop running=True closed=False debug=False> at 0x7f0fbe7cfd68
WORKER PID: 21948, LOOP: <_UnixSelectorEventLoop running=True closed=False debug=False> at 0x7f0fbe7cfd68
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "test.py", line 13, in worker
    return loop.run_until_complete(worker_coro())
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 454, in run_until_complete
    self.run_forever()
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 408, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "test.py", line 25, in <module>
    loop.run_until_complete(main())
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "test.py", line 21, in main
    return await loop.run_in_executor(executor, worker)
RuntimeError: This event loop is already running
History
Date User Action Args
2017-07-19 22:49:35Elvis.Pranskevichussetrecipients: + Elvis.Pranskevichus, yselivanov
2017-07-19 22:49:35Elvis.Pranskevichussetmessageid: <1500504575.06.0.700406850987.issue30972@psf.upfronthosting.co.za>
2017-07-19 22:49:34Elvis.Pranskevichuslinkissue30972 messages
2017-07-19 22:49:34Elvis.Pranskevichuscreate