Open hknielsen opened 5 months ago
Seems related to https://github.com/dotnet/sdk/issues/9303 and https://github.com/dotnet/sdk/issues/20183. Could this use the same SharedCompilationId
property as Roslyn?
Seems related to dotnet/sdk#9303 and dotnet/sdk#20183. Could this use the same
SharedCompilationId
property as Roslyn?
It would make alot of sense that all MSBuild nodes and Roslyn would use the same Identifier, passing along the MSBuild SharedId to Roslyn.
@KalleOlaviNiemitalo updated the proposal to use the same Shared-Id
between Roslyn and MSBuild
@hknielsen sorry, I can't repro your issue as the following steps. Did you repro you issue in your specified repo? or is there anything that I missed?
@JaynieBai We were seeing it randomly in CI. Basically it was related to rebuilds on multiple clones using the same msbuild server, where one finished and shutsdown the server.
@hknielsen and to be clear: you are explicitly setting DOTNET_CLI_USE_MSBUILD_SERVER
in your CI jobs?
@rainersigwald - yeah, we are setting the env var to enable the MSBuild Servier. And calling shutdown when done. We were also not only using this on CI, so when we are done building, we cleanup resources, including shutdown the MSBuild Server
Roslyn/Razor are also hitting similar issues with the Razor compiler server and the build-server shutdown
command. cc @jaredpar - it would be cool if we could find a reusable solution for our different servers.
I agree that we need to find a reusable solution for our different servers. Right now we're all solving the same problem but in different ways which each have their own flaws.
Summary
Server reuse across clones, can lead to issues when Shutdown, leading to errors.
Background and Motivation
When having multiple Clones of the same repository using MSBuild Server for speeding up compilation, we end up in situations where the MSBuild Server gets shutdown from the other clone, while a compilation is ongoing, resulting in errors because of Server Shutdown.
Our setup:
Proposed Feature
Add an Identifier to the started server + nodes started by the server, so repositories can't interfere with each other. It would be optimal if:
SharedId
CommunicationsUtilities.GetHandshakeOptions
so it would work as today if no extra identifier was added.MSBuildClient
to support MSBuild Server Identifier.SharedId
to pass to Roslyn's similar conceptSharedCompilationId
This would make it easier to control multiple msbuild servers that can't interfere with eachother.
Alternative Designs
The MSBuild Server is identified with the location, so if we have two copies of MSBuild, each would have a unique identity and MSBuild Server + Nodes.