From daeafc06f96a640d675bf10dee96e152803ecb88 Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Tue, 6 Jan 2026 15:49:25 +0000 Subject: [PATCH] src: use node- prefix on thread names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/61307 Reviewed-By: Matteo Collina Reviewed-By: Stephen Belanger Reviewed-By: Gerhard Stöbich Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Rafael Gonzaga --- src/node.cc | 2 +- src/node_platform.cc | 2 +- test/addons/uv-thread-name/test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index 8367227dd56..39505548c45 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1234,7 +1234,7 @@ InitializeOncePerProcessInternal(const std::vector& args, } if (!(flags & ProcessInitializationFlags::kNoInitializeNodeV8Platform)) { - uv_thread_setname("MainThread"); + uv_thread_setname("node-MainThread"); per_process::v8_platform.Initialize( static_cast(per_process::cli_options->v8_thread_pool_size)); result->platform_ = per_process::v8_platform.Platform(); diff --git a/src/node_platform.cc b/src/node_platform.cc index 4815e8acd99..197102068b7 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -49,7 +49,7 @@ static void PrintSourceLocation(const v8::SourceLocation& location) { } static void PlatformWorkerThread(void* data) { - uv_thread_setname("V8Worker"); + uv_thread_setname("node-V8Worker"); std::unique_ptr worker_data(static_cast(data)); diff --git a/test/addons/uv-thread-name/test.js b/test/addons/uv-thread-name/test.js index e5e2b949502..be92fc2ab5d 100644 --- a/test/addons/uv-thread-name/test.js +++ b/test/addons/uv-thread-name/test.js @@ -12,7 +12,7 @@ const bindingPath = require.resolve(`./build/${common.buildType}/binding`); const binding = require(bindingPath); if (isMainThread) { - assert.strictEqual(binding.getThreadName(), 'MainThread'); + assert.strictEqual(binding.getThreadName(), 'node-MainThread'); const worker = new Worker(__filename); worker.on('message', common.mustCall((data) => {