You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic to handle exceptions thrown on logging and communication threads was trying to make the build submission fail with the exception but it didn't always complete it. This manifested as the build hanging, for example when building with MSBUILDNODECONNECTIONTIMEOUT = 0, which is almost guaranteed to throw InternalErrorException in InstantiateNode.
This PR fixes it by making sure that all submissions are completed in OnThreadException. Unlike the original code, proper care is taken to avoid race conditions - i.e. the build result is mutated only if hasn't already been passed to the completion handler.
Fixes#5911
Issue Description
MSBuild hangs when attempting to build with the
MSBUILDNODECONNECTIONTIMEOUT
environment variable set to 0.Steps to Reproduce
repro.proj:
Expected Behavior
The build fails with an internal error like "In-proc node failed to start up within 0ms".
Actual Behavior
The build hangs.
Analysis
Caused by the
BuildSubmission
not getting completed if an exception categorized as "critical" is thrown.The exception is thrown here:
msbuild/src/Build/BackEnd/Components/Communications/NodeProviderInProc.cs
Line 370 in f762c39
And caught here:
msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs
Line 1216 in f762c39
Versions & Configurations
Version 16.8.2+25e4d540b
The text was updated successfully, but these errors were encountered: