Skip to content
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

A build with /nodeReuse:false will reuse nodes that were left running by a previous build #339

Closed
rainersigwald opened this issue Nov 6, 2015 · 4 comments

Comments

@rainersigwald
Copy link
Contributor

Consider this:

msbuild /m /nr:true someBigProject.proj
msbuild /m /nr:false someOtherProject.proj

Most people would expect the first build to leave child processes running (that being the point of the /nodeReuse flag). The second shouldn't leave any new processes running.

What's surprising is that the second build will reuse processes left over from the first build. That causes problems if you have per-node state, or if you're looking at I/O from the process cone of MSBuild.

This appears to be intentional but I can't justify the behavior. I think we should change /nr:false to always spawn new processes.

@rainersigwald
Copy link
Contributor Author

It looks like we already have a "handshake" process to determine whether a given worker node is in the right elevation level, username, and so on. I think we can add "is allowed to be reused" to that safely. See https://github.com/Microsoft/msbuild/blob/ab862ac37e6c5c828dea9f2c5fc492d02310b8cb/src/XMakeBuildEngine/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs#L155

rainersigwald added a commit to rainersigwald/msbuild that referenced this issue Nov 11, 2015
This allows a host to avoid reusing a node leftover from a prior
/nr:true build if the current build is /nr:false. Required for dotnet#339.
rainersigwald added a commit to rainersigwald/msbuild that referenced this issue Nov 11, 2015
This allows a host to avoid reusing a node leftover from a prior
/nr:true build if the current build is /nr:false. Required for dotnet#339.
rainersigwald added a commit to rainersigwald/msbuild that referenced this issue Nov 12, 2015
This allows a host to avoid reusing a node leftover from a prior
/nr:true build if the current build is /nr:false. Required for dotnet#339.
@rainersigwald
Copy link
Contributor Author

This change has been ported to our internal repo as well, so it should be available in Update 2.

radical pushed a commit to radical/msbuild that referenced this issue Feb 27, 2020
…0226.2 (dotnet#339)

- Microsoft.Dotnet.Toolset.Internal - 3.1.200-preview.20126.2

Dependency coherency updates

- Microsoft.NET.Sdk - 3.1.200-preview.20126.2 (parent: Microsoft.Dotnet.Toolset.Internal)
@petervlad
Copy link

Anyone still has this problem? Using VS 2019. Because of the processes left behind I have errors like this one: MSB3191 Unable to create directory "obj\Debug\net472". Access to the path 'obj\Debug\net472' is denied

@rainersigwald
Copy link
Contributor Author

@petervlad please file a new issue describing your problem in detail. This issue would not have resulted in that error.

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

No branches or pull requests

2 participants