-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Shutdown build servers via named pipes #50429
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
Draft
jjonescz
wants to merge
25
commits into
dotnet:release/10.0.1xx
Choose a base branch
from
jjonescz:build-server-pipes
base: release/10.0.1xx
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fbd7f81
Shutdown build servers via named pipes
jjonescz 33e4159
Fix merge to use new name
baronfel 2fda215
Fix test compilation errors
jjonescz 2256b9a
Avoid net472 build failures
jjonescz 08241ab
Avoid creating directory unnecessarily
jjonescz b7ac475
Suppress unrelated obsolete warning
jjonescz 175efa4
Remove superfluous blank line
jjonescz bb2558c
Report progress not as error
jjonescz 9766bd6
Move client util in
jjonescz 981e302
Improve exception handling
jjonescz 47d6e12
Merge branch 'main' into build-server-pipes
jjonescz 4dfa818
Merge branch 'main' into build-server-pipes
jjonescz 4e7696c
Update pipe handling
jjonescz 37405a4
Clarify message
jjonescz 6928215
Fix enum
jjonescz 898df82
Add a test
jjonescz 534aee0
Use custom Roslyn version
jjonescz b1e9f48
Merge branch 'release/10.0.1xx' into build-server-pipes
jjonescz 746e52d
Update snapshots
jjonescz a2fba3e
Fix mocking
jjonescz 4efbcc1
Capture roslyn logs to help diagnosing test
jjonescz b27f7f6
Use XxHash128
jjonescz 916b4cf
Clarify docs around directory permissions
jjonescz 2e928a6
Avoid running the test in parallel with others
jjonescz fe2a021
Timeout when waiting for process exit
jjonescz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Shutdown build servers via named pipes
- Loading branch information
commit fbd7f810fe3da61f31ae17b001fc5a3034aa27c4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,5 +11,5 @@ internal interface IBuildServer | |
|
|
||
| string Name { get; } | ||
|
|
||
| void Shutdown(); | ||
| Task ShutdownAsync(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Microsoft.DotNet.Cli.Commands; | ||
| using Microsoft.DotNet.Cli.Utils; | ||
| using Microsoft.DotNet.Cli.Utils.Extensions; | ||
| using Microsoft.Net.BuildServerUtils; | ||
|
|
||
| namespace Microsoft.DotNet.Cli.BuildServer; | ||
|
|
||
| internal sealed class UnifiedBuildServer : IBuildServer | ||
| { | ||
| public int ProcessId => 0; // Not used | ||
|
|
||
| public string Name => CliCommandStrings.UnifiedBuildServer; | ||
|
|
||
| public Task ShutdownAsync() | ||
| { | ||
| var hostServerPath = MSBuildForwardingAppWithoutLogging.GetHostServerPath(); | ||
| Reporter.Output.WriteLine(CliCommandStrings.ShuttingDownUnifiedBuildServers, hostServerPath); | ||
|
|
||
| return BuildServerUtility.ShutdownServersAsync( | ||
| onProcessShutdownBegin: static (process) => | ||
| { | ||
| Reporter.Error.WriteLine(string.Format(CliCommandStrings.ShuttingDownServerWithPid, process.ProcessName, process.Id).Red()); | ||
| }, | ||
| onError: static (error) => | ||
| { | ||
| Reporter.Error.WriteLine(string.Format(CliCommandStrings.ShutDownFailed, CliCommandStrings.UnifiedBuildServer, error).Red()); | ||
| }, | ||
| hostServerPath: hostServerPath); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
The comment there looks misleading.
If the directory exists already, then CreateDirectory ignores the UnixFileMode, except throws if the argument contains undefined bits.
If the directory does not exist yet, then CreateDirectory passes the UnixFileMode to the mkdir system call, which uses it when creating the directory. But the umask of the process may cause mkdir not to grant all the permissions listed in the UnixFileMode. That would be the user's misconfiguration though; it is not reasonable to expect programs to work if the umask prevents permissions from being granted to the user.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks, that's indeed not what I've expected. But I think the behavior is acceptable, I will just update the comment.