Uh oh!
There was an error while loading. Please reload this page.
bpo-35621: Support running subprocesses in asyncio when loop is executed in non-main thread - #14344
Conversation
…en loop is executed in non-main thread (python#13630)" (pythonGH-13793)" This reverts commit 9535aff.
asvetlov
commented
Jun 24, 2019
I tested it with manual adding 1-second timeout in spawned waiter threads to emulate slow test machine. |
| def add_child_handler(self, pid, callback, *args): | ||
| assert self._forks, "Must use the context manager" | ||
| if self._loop is None: |
There was a problem hiding this comment.
The check is replaced by watcher.is_active() call in subprocess transport
1st1
left a comment
There was a problem hiding this comment.
LGTM overall. Thanks for pushing this through, Andrew.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Yury Selivanov <yury@magic.io>
Co-Authored-By: Yury Selivanov <yury@magic.io>
Co-Authored-By: Yury Selivanov <yury@magic.io>
Co-Authored-By: Yury Selivanov <yury@magic.io>
Co-Authored-By: Yury Selivanov <yury@magic.io>
Co-Authored-By: Yury Selivanov <yury@magic.io>
asvetlov
commented
Jun 30, 2019
Thanks for review! |
miss-islington
commented
Jun 30, 2019
Thanks @asvetlov for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
bedevere-bot
commented
Jun 30, 2019
GH-14484 is a backport of this pull request to the 3.8 branch. |
…ted in non-main thread (pythonGH-14344) (cherry picked from commit 0d671c0) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…ted in non-main thread (pythonGH-14344)
…ted in non-main thread (pythonGH-14344)
PR #5862 Refs: * pytest-dev/pytest-xdist#620 * https://stackoverflow.com/a/58614689/595220 * https://bugs.python.org/issue35621 * python/cpython#14344 * https://docs.python.org/3/library/asyncio-policy.html#asyncio.MultiLoopChildWatcher Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
PR #5862 Refs: * pytest-dev/pytest-xdist#620 * https://stackoverflow.com/a/58614689/595220 * https://bugs.python.org/issue35621 * python/cpython#14344 * https://docs.python.org/3/library/asyncio-policy.html#asyncio.MultiLoopChildWatcher Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com> (cherry picked from commit 7080a8b)
With Python 3.7 asynchronous tests randomly fail with "RuntimeError: Event loop is closed" during shutdown. Backtrace of the error includes `SafeChildWatcher` calls. Python 3.8 has replaced `SafeChildWatcher` with a new `ThreadedChildWatcher` by default [1] as a bugfix for "asyncio.create_subprocess_exec() only works with main event loop" bug [2]. Python 3.7 scheduled end of life is 2023-06-27 according to <https://devguide.python.org/versions/>. [1] python/cpython#14344 [2] https://bugs.python.org/issue35621
With Python 3.7 asynchronous tests randomly fail with "RuntimeError: Event loop is closed" during shutdown. Backtrace of the error includes `SafeChildWatcher` calls. Python 3.8 has replaced `SafeChildWatcher` with a new `ThreadedChildWatcher` by default [1] as a bugfix for "asyncio.create_subprocess_exec() only works with main event loop" bug [2]. Python 3.7 scheduled end of life is 2023-06-27 according to <https://devguide.python.org/versions/>. [1] python/cpython#14344 [2] https://bugs.python.org/issue35621
With Python 3.7 asynchronous tests randomly fail with "RuntimeError: Event loop is closed" during shutdown. Backtrace of the error includes `SafeChildWatcher` calls. Python 3.8 has replaced `SafeChildWatcher` with a new `ThreadedChildWatcher` by default [1] as a bugfix for "asyncio.create_subprocess_exec() only works with main event loop" bug [2]. Python 3.7 scheduled end of life is 2023-06-27 according to <https://devguide.python.org/versions/>. [1] python/cpython#14344 [2] https://bugs.python.org/issue35621
With Python 3.7 asynchronous tests randomly fail with "RuntimeError: Event loop is closed" during shutdown. Backtrace of the error includes `SafeChildWatcher` calls. Python 3.8 has replaced `SafeChildWatcher` with a new `ThreadedChildWatcher` by default [1] as a bugfix for "asyncio.create_subprocess_exec() only works with main event loop" bug [2]. Python 3.7 scheduled end of life is 2023-06-27 according to <https://devguide.python.org/versions/>. [1] python/cpython#14344 [2] https://bugs.python.org/issue35621
The resurrection of #13630
Now without dangling threads in tests :)
https://bugs.python.org/issue35621