Skip to content

Commit

Permalink
bpo-39609: set the thread_name_prefix for the default asyncio executor (
Browse files Browse the repository at this point in the history
pythonGH-18458)

Just a small debugging improvement to identify the asyncio executor threads.
  • Loading branch information
mmohrhard authored Feb 27, 2020
1 parent 02a4d57 commit 374d998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,9 @@ def run_in_executor(self, executor, func, *args):
# Only check when the default executor is being used
self._check_default_executor()
if executor is None:
executor = concurrent.futures.ThreadPoolExecutor()
executor = concurrent.futures.ThreadPoolExecutor(
thread_name_prefix='asyncio'
)
self._default_executor = executor
return futures.wrap_future(
executor.submit(func, *args), loop=self)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add thread_name_prefix to default asyncio executor

0 comments on commit 374d998

Please sign in to comment.