]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39609: set the thread_name_prefix for the default asyncio executor (GH-18458)
authorMarkus Mohrhard <markusm@dug.com>
Thu, 27 Feb 2020 20:01:47 +0000 (04:01 +0800)
committerGitHub <noreply@github.com>
Thu, 27 Feb 2020 20:01:47 +0000 (12:01 -0800)
Just a small debugging improvement to identify the asyncio executor threads.

Lib/asyncio/base_events.py
Misc/NEWS.d/next/Library/2020-02-11-19-45-31.bpo-39609.dk40Uw.rst [new file with mode: 0644]

index d78724b015370e6b2a2b1408aa23c64f4b0fffc7..b2d446a51fedb50a75b7c72ba093799705e99257 100644 (file)
@@ -806,7 +806,9 @@ class BaseEventLoop(events.AbstractEventLoop):
             # 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 (file)
index 0000000..233fad3
--- /dev/null
@@ -0,0 +1 @@
+Add thread_name_prefix to default asyncio executor