From 3d3e982e562e28480d287aebdc74dad2b378fe0a Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Wed, 11 Mar 2026 12:18:58 -0500 Subject: [PATCH 1/2] Look for apphost when considering node reuse There was a collision between #13220 (at end of build, look for other running MSBuild processes and decide whether node reuse is likely to be worthwhile) and #13175 (use an apphost on core). This broke the overprovisioning detection, which was looking for `dotnet[.exe]` instead of the new `MSBuild[.exe]`. Always search for `MSBuild[.exe]` instead, and remove the now-unnecesary "try to filter `dotnet.exe` processes to those running `MSBuild.dll` code too. --- .../Communications/NodeProviderOutOfProcBase.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs index 9f701208dde..a2ed686d7fb 100644 --- a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs +++ b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs @@ -635,8 +635,7 @@ internal static int CountActiveNodesWithMode(NodeMode nodeMode) private static (string expectedProcessName, IList nodeProcesses) GetPossibleRunningNodes(NodeMode? expectedNodeMode) { - string msbuildLocation = Constants.MSBuildExecutableName; - var expectedProcessName = Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost() ?? msbuildLocation); + var expectedProcessName = Constants.MSBuildExecutableName; Process[] processes; try @@ -651,7 +650,6 @@ private static (string expectedProcessName, IList nodeProcesses) GetPos if (expectedNodeMode.HasValue && ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave18_5)) { List filteredProcesses = []; - bool isDotnetProcess = expectedProcessName.Equals(Path.GetFileNameWithoutExtension(Constants.DotnetProcessName), StringComparison.OrdinalIgnoreCase); foreach (var process in processes) { @@ -668,11 +666,6 @@ private static (string expectedProcessName, IList nodeProcesses) GetPos continue; } - if (isDotnetProcess && !commandLine.Contains("MSBuild.dll", StringComparison.OrdinalIgnoreCase)) - { - continue; - } - NodeMode? processNodeMode = NodeModeHelper.ExtractFromCommandLine(commandLine); if (processNodeMode.HasValue && processNodeMode.Value == expectedNodeMode.Value) { From 8daca3374b4e3cb6db5610dda2a8a3251c8e6fa7 Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Wed, 11 Mar 2026 12:56:27 -0500 Subject: [PATCH 2/2] Apply suggestion from @rainersigwald --- .../Components/Communications/NodeProviderOutOfProcBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs index a2ed686d7fb..3a978e0cfec 100644 --- a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs +++ b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs @@ -635,7 +635,7 @@ internal static int CountActiveNodesWithMode(NodeMode nodeMode) private static (string expectedProcessName, IList nodeProcesses) GetPossibleRunningNodes(NodeMode? expectedNodeMode) { - var expectedProcessName = Constants.MSBuildExecutableName; + var expectedProcessName = Constants.MSBuildAppName; Process[] processes; try