-
Notifications
You must be signed in to change notification settings - Fork 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
Add shutdown argument to VBCSCompiler #7930
Conversation
retest please |
@dotnet-bot retest prtest/lin/dbg/unit32 please |
What's the motivation here? |
@agocke there were an increasing number of scenarios where we wanted to shutdown a specific compiler server gracefully without waiting for the timeout to expire. Typically in order to get it to release references to the compiler DLLs. The scenarios we had hit:
Killing all VBCSCompiler instances, while safe, is a bit hacky. Having a definitive shutdown seemed like a much more palatable option. |
@@ -268,7 +256,9 @@ public enum ResponseType | |||
{ | |||
MismatchedVersion, | |||
Completed, | |||
AnalyzerInconsistency | |||
AnalyzerInconsistency, | |||
Shutdown, |
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.
What does response Shutdown mean?
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 think members of this enum deserve good comments.
LGTM |
1 similar comment
LGTM |
Cleaned up a couple of small style issues.
Extends the build server protocol to support requests to shut down the server. The response is the ID of the server process the caller can wait on for completion.
Added a test to verify the shutdown operation is passive. If any existing compilations are in progress they will be allowed to complete after the shutdown is received. This required a bit of code refactoring. It needed to be easier to intercept compilation requests and block on them until a given set of events had completed.
This changes the server to respond to shutdown requests through the entire lifetime of the server. This means even in a shutting down state it will still respond to clients with a process id.
Add shutdown argument to VBCSCompiler
This adds a
-shutdown
argument to VBCSCompiler that allows clients to gracefully shutdown the server. This is implemented by adding a new message to the protocol which does two actions:When reviewing the changes to
ServerDispatcher
it's important to understand the difference between the following operations:CancellationToken
passed into the server is signaled. In this case the server will cancel all previously scheduled build requests and accept no new connections. In other words, cancel as fast as possible.closes #7115
CC @dotnet/roslyn-compiler