Skip to content

ShutdownAllNodes / dotnet build-server shutdown broken when AppHost is used #13508

@rainersigwald

Description

@rainersigwald

Take an SDK that uses the apphost, for example 10.0.300-preview.0.26177.108 that I have installed on my machine. It launches worker nodes as MSBuild.exe, but the code that tries to query for running nodes, when called from ShutdownAllNodes() that doesn't specify executable path or anything

private (string expectedProcessName, IList<Process> nodeProcesses) GetPossibleRunningNodes(
string msbuildLocation = null,
NodeMode? expectedNodeMode = null)
{
bool isNativeHost = msbuildLocation != null && Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase);
string expectedProcessName = Path.GetFileNameWithoutExtension(isNativeHost ? msbuildLocation : (CurrentHost.GetCurrentHost() ?? msbuildLocation));
Process[] processes;
try
{
processes = Process.GetProcessesByName(expectedProcessName);

tries to query for dotnet, which will not find idle worker nodes.

#13501 worked around an issue related to this for .NET Framework MSBuild, but doesn't resolve the problem described in this bug.

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions