You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set the thread_name_prefix for asyncio's default executor ThreadPoolExecutor #83790
The ThreadPoolExecutor in BaseEventLoop.run_in_executor should set a thread_name_prefix to simplify debugging.
Might also be worth to limit the number of max threads. On our 256 core machines we sometimes get 1000+ threads due to the cpu_count() * 5 default limit.
I'm curious if there is a specific reason you prefer to use the default executor rather than replacing it with your own? Is it just convenience or are there other reasons?
mmohrhard commented on Feb 18, 2020
mmohrhardmannequin
MannequinAuthor
More actions
We have by now changed to a custom executor. Asyncio is used in some of our dependencies and therefore it took some work to figure out what is creating the thousands of threads that we were seeing.
This patch was part of the debuggin and we thought it would be useful for anyone else to immediately see what is creating the threads.
Activity
mmohrhard commentedon Feb 11, 2020
The ThreadPoolExecutor in BaseEventLoop.run_in_executor should set a thread_name_prefix to simplify debugging.
Might also be worth to limit the number of max threads. On our 256 core machines we sometimes get 1000+ threads due to the cpu_count() * 5 default limit.
cjrh commentedon Feb 17, 2020
This change seems fine.
Markus,
I'm curious if there is a specific reason you prefer to use the default executor rather than replacing it with your own? Is it just convenience or are there other reasons?
mmohrhard commentedon Feb 18, 2020
We have by now changed to a custom executor. Asyncio is used in some of our dependencies and therefore it took some work to figure out what is creating the thousands of threads that we were seeing.
This patch was part of the debuggin and we thought it would be useful for anyone else to immediately see what is creating the threads.
miss-islington commentedon Feb 27, 2020
New changeset 374d998 by Markus Mohrhard in branch 'master':
bpo-39609: set the thread_name_prefix for the default asyncio executor (GH-18458)
374d998