Skip to content

Avoid node reuse during desktop-hosted builds#896

Merged
rainersigwald merged 1 commit intodotnet:xplatfrom
rainersigwald:disable-selfhost-node-reuse
Aug 17, 2016
Merged

Avoid node reuse during desktop-hosted builds#896
rainersigwald merged 1 commit intodotnet:xplatfrom
rainersigwald:disable-selfhost-node-reuse

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

If msbuild is invoked with the (default) /nodeReuse:true argument,
worker nodes hang around for a period of time after the build is complete
to see if more work will be incoming. This is normally a nice
startup-time-reducing perf optimization. But in our own build, it means
that many newly-created MSBuild assemblies are opened and uneditable,
failing builds and causing cleans to fail.

Changing the Windows build script to just always pass /nodeReuse:false.

@jeffkl
Copy link
Copy Markdown
Contributor

jeffkl commented Aug 11, 2016

LGTM

@rainersigwald
Copy link
Copy Markdown
Member Author

D'oh, forgot that we dropped that switch entirely on core, not just made it a no-op.

@jeffkl
Copy link
Copy Markdown
Contributor

jeffkl commented Aug 11, 2016

Is this because there is no node reuse on core? Or you can't turn it off on core?

@rainersigwald
Copy link
Copy Markdown
Member Author

@jeffkl You can't turn it on. The way it's implemented on Windows uses a named pipe named after the PID, so you can enumerate all MSBuild processes and ask if they're available for your use. But that's a potential elevation-of-privilege attack if you can talk to an elevated process (or another user) while yourself running in low-priv mode. Windows provides APIs to check that both sides of the pipe are the same user + elevation level, but other OSes don't, so we just cut the feature for Core. See 86f213b and #506.

@jeffkl
Copy link
Copy Markdown
Contributor

jeffkl commented Aug 11, 2016

Interesting, well then I'm sure you know what to do, conditionally add the argument...

@cdmihai
Copy link
Copy Markdown
Contributor

cdmihai commented Aug 16, 2016

Can you branch whether to use the switch or not in the caller of build.cmd? I think that one knows what the targeting configuration is.

@rainersigwald
Copy link
Copy Markdown
Member Author

Yeah, I'll do that in the next iteration, as soon as I get a free minute.

If msbuild is invoked with the (default) `/nodeReuse:true` argument,
worker nodes hang around for a period of time after the build is complete
to see if more work will be incoming. This is normally a nice
startup-time-reducing perf optimization. But in our own build, it means
that many newly-created MSBuild assemblies are opened and uneditable,
failing builds and causing cleans to fail.

Changing the Windows build script to just always pass `/nodeReuse:false`
when not using the CoreCLR MSBuild.
@rainersigwald rainersigwald force-pushed the disable-selfhost-node-reuse branch from 284cbee to 92d1d6a Compare August 17, 2016 15:28
@rainersigwald
Copy link
Copy Markdown
Member Author

Turned out to be easier to branch inside build.cmd but after checking for a host.

@AndyGerlicher
Copy link
Copy Markdown
Contributor

:shipit:

@rainersigwald rainersigwald merged commit 0ac4488 into dotnet:xplat Aug 17, 2016
@rainersigwald rainersigwald deleted the disable-selfhost-node-reuse branch August 17, 2016 17:59
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

Successfully merging this pull request may close these issues.

5 participants