bpo-39609: set the thread_name_prefix for the default asyncio executor (GH-18458)
https://github.com/python/cpython/commit/374d998b507d34a6c0a3816a163926a8ba0... commit: 374d998b507d34a6c0a3816a163926a8ba0c483f branch: master author: Markus Mohrhard <markusm@dug.com> committer: GitHub <noreply@github.com> date: 2020-02-27T12:01:47-08:00 summary: 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. files: A Misc/NEWS.d/next/Library/2020-02-11-19-45-31.bpo-39609.dk40Uw.rst M Lib/asyncio/base_events.py diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index d78724b015370..b2d446a51fedb 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -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) diff --git a/Misc/NEWS.d/next/Library/2020-02-11-19-45-31.bpo-39609.dk40Uw.rst b/Misc/NEWS.d/next/Library/2020-02-11-19-45-31.bpo-39609.dk40Uw.rst new file mode 100644 index 0000000000000..233fad3e763d6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-11-19-45-31.bpo-39609.dk40Uw.rst @@ -0,0 +1 @@ +Add thread_name_prefix to default asyncio executor
participants (1)
-
Markus Mohrhard