Skip to content

Include node id in in-proc node thread name - #12902

Merged
JanProvaznik merged 2 commits into
mainfrom
copilot/add-nodeid-to-name
Dec 9, 2025
Merged

JanProvaznik merged 2 commits into
mainfrom
copilot/add-nodeid-to-name

Conversation

Copilot AI commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor
  1. Fixes

  2. Context

  • In-proc node thread names omitted the node identifier, making thread identification harder when multiple nodes run under the same host.
  1. Changes Made

  • Updated NodeProviderInProc to embed nodeId in the thread name when spinning up an in-proc node thread:
    • nodeContext._inProcNodeThread.Name = $"In-proc Node {nodeId} ({_componentHost.Name})";

Example:

// Thread name now clearly identifies the node:
"In-proc Node 3 (BackEnd.MockHost)"
  1. Testing

  • Build succeeded: ./build.sh -v quiet
  • Bootstrapped environment and verified SDK: source artifacts/sdk-build-env.sh && dotnet --version
  • Sample build: dotnet build src/Samples/Dependency/Dependency.csproj
  • Targeted tests (known existing failures remain unrelated): dotnet test src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj -m:1
  1. Notes

  • Targeted test run reports pre-existing failures in BinaryLogger roundtrip and ProjectGraph target list expectations; no changes made to those areas in this PR.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dnceng.pkgs.visualstudio.com
    • Triggering command: /home/REDACTED/work/msbuild/msbuild/artifacts/bin/bootstrap/core/dotnet dotnet build src/Samples/Dependency/Dependency.csproj (dns block)
    • Triggering command: /home/REDACTED/work/msbuild/msbuild/artifacts/bin/bootstrap/core/dotnet dotnet test src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj -m:1 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

On NodeProviderInProc.cs:373-373, add {nodeId} to this name


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

Copilot AI changed the title [WIP] Add {nodeId} to name in NodeProviderInProc.cs Include node id in in-proc node thread name Dec 9, 2025
Copilot AI requested a review from JanProvaznik December 9, 2025 14:09
@JanProvaznik
JanProvaznik marked this pull request as ready for review December 9, 2025 14:14
Copilot AI review requested due to automatic review settings December 9, 2025 14:14
@JanProvaznik
JanProvaznik enabled auto-merge (squash) December 9, 2025 14:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves debugging of multi-node MSBuild scenarios by adding the node identifier to in-proc node thread names. Previously, all in-proc node threads had identical names (e.g., "In-proc Node (BackEnd.MockHost)"), making it difficult to distinguish between them when multiple nodes run under the same host.

  • Enhanced thread naming by embedding the node ID: "In-proc Node {nodeId} ({_componentHost.Name})"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants