-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TL failure on MSBUILDNOINPROCNODE env variable #9388
Fix TL failure on MSBUILDNOINPROCNODE env variable #9388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this fix is addressing the root cause of the issue. It rather hides it by suppressing the live output.
The crash is caused by the fact that single-process build passes 1 as nodeCount
to the logger's Initialize
method, but the out-of-proc node created with MSBUILDNOINPROCNODE=1
has NodeId
of 2.
It may be reasonable to simply use nodeIndex = Math.Min(nodeIndex, _nodes.Length - 1)
but we should be sure that it only kicks in in this scenario, i.e. that we don't end up with two nodes using the same _nodes
slot. Another safe option would be to create the _nodes
array one bigger than what's indicated by nodeCount
.
To see why the current fix does not fully work, please try a long-running build with MSBUILDNOINPROCNODE=1
and see if live output is working.
Another option: Make |
Oh, I see! thank you for letting me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you.
Co-authored-by: Ladi Prosek <ladi.prosek@gmail.com>
…uliiaKovalova/msbuild into dev/ykovalova/address_TL_crash
Fixes #9322
Context
In an attempt to build an invalid project with MSBUILDNOINPROCNODE=1, the exception "Out of boundary" was thrown.
Changes Made
Add a check before accessing the array element by index.
Testing
UTs are added