bpo-39609: set the thread_name_prefix for the default asyncio executor (GH-18458)

Just a small debugging improvement to identify the asyncio executor threads.
This commit is contained in:
Markus Mohrhard 2020-02-28 04:01:47 +08:00 committed by GitHub
parent 02a4d57263
commit 374d998b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -806,7 +806,9 @@ class BaseEventLoop(events.AbstractEventLoop):
# Only check when the default executor is being used # Only check when the default executor is being used
self._check_default_executor() self._check_default_executor()
if executor is None: if executor is None:
executor = concurrent.futures.ThreadPoolExecutor() executor = concurrent.futures.ThreadPoolExecutor(
thread_name_prefix='asyncio'
)
self._default_executor = executor self._default_executor = executor
return futures.wrap_future( return futures.wrap_future(
executor.submit(func, *args), loop=self) executor.submit(func, *args), loop=self)

View File

@ -0,0 +1 @@
Add thread_name_prefix to default asyncio executor