Skip to content

spawn asyncio subprocesses in a thread pool #81444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asvetlov opened this issue Jun 13, 2019 · 4 comments
Open

spawn asyncio subprocesses in a thread pool #81444

asvetlov opened this issue Jun 13, 2019 · 4 comments
Labels
3.13 bugs and security fixes OS-windows performance Performance or resource usage topic-asyncio type-feature A feature request or enhancement

Comments

@asvetlov
Copy link
Contributor

BPO 37263
Nosy @asvetlov, @1st1

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2019-06-13.07:58:27.658>
labels = ['expert-asyncio', 'performance']
title = 'spawn asyncio subprocesses in a thread pool'
updated_at = <Date 2020-09-21.19:37:55.666>
user = 'https://github.com/asvetlov'

bugs.python.org fields:

activity = <Date 2020-09-21.19:37:55.666>
actor = 'iritkatriel'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['asyncio']
creation = <Date 2019-06-13.07:58:27.658>
creator = 'asvetlov'
dependencies = []
files = []
hgrepos = []
issue_num = 37263
keywords = []
message_count = 1.0
messages = ['345472']
nosy_count = 2.0
nosy_names = ['asvetlov', 'yselivanov']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue37263'
versions = []

@asvetlov
Copy link
Contributor Author

Subprocess starting can be a long blocking operation, see python-trio/trio#1109 for discussion

@iritkatriel iritkatriel added topic-asyncio performance Performance or resource usage labels Sep 21, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@ezio-melotti ezio-melotti moved this to Todo in asyncio Jul 17, 2022
@ezio-melotti ezio-melotti moved this from Todo to In Progress in asyncio Jul 17, 2022
@ezio-melotti ezio-melotti moved this from In Progress to Todo in asyncio Jul 17, 2022
@iritkatriel iritkatriel added type-feature A feature request or enhancement 3.12 only security fixes labels Sep 9, 2022
@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Oct 9, 2022

From the Trio issue, this seems mostly a Windows issue where process creation is indeed very slow. So maybe this should be only done for Windows.

@gvanrossum
Copy link
Member

I'm just realizing that when we use the ThreadedChildWatcher, there's a thread created for the process anyway, so maybe we could move the subprocess operation into that thread... (Then again on Windows we don't use child watchers.)

@erlend-aasland erlend-aasland added 3.13 bugs and security fixes and removed 3.12 only security fixes labels Jan 5, 2024
@willingc
Copy link
Contributor

@kumaraditya303 Flagging this as an FYI as you look at the work for #120804. After that work is completed, we can revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes OS-windows performance Performance or resource usage topic-asyncio type-feature A feature request or enhancement
Projects
Status: No status
Status: Todo
Development

No branches or pull requests

6 participants