Don't log named pipe connection failures as errors in BuildServerConnection#82609
Merged
Conversation
When a named pipe connection times out (IOException/TimeoutException), the previous LogException call generated "Error Error: 'IOException' 'The semaphore timeout period has expired.'" which matches a canonical error format, causing MSBuild's Exec task to treat it as a build error. Since connection timeout is a recoverable/transient condition (the caller retries or falls back to command-line), change to a plain logger.Log call that preserves the diagnostic info without the "Error:" prefix. Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix IOException reporting during Visual Studio build
Don't log named pipe connection timeout as an error
Mar 3, 2026
jjonescz
reviewed
Mar 3, 2026
…nection.cs Same issue: pipe ownership failure and general connect exceptions are also recoverable (both return null → fallback to CLI compiler), so they should not be logged with an "Error:" prefix that could trigger MSBuild's canonical error detection. Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot
AI
changed the title
Don't log named pipe connection timeout as an error
Don't log named pipe connection failures as errors in BuildServerConnection
Mar 3, 2026
jjonescz
approved these changes
Mar 3, 2026
jaredpar
approved these changes
Mar 4, 2026
RikkiGibson
approved these changes
Mar 4, 2026
| { | ||
| pipeStream.Dispose(); | ||
| logger.LogError("Owner of named pipe is incorrect"); | ||
| logger.Log("Owner of named pipe is incorrect"); |
Member
There was a problem hiding this comment.
Not blocking: Why not log this as an error? It feels like getting in this situation, requires a more specific "step" to get things wrong. i.e. the wrong user opening a named pipe that happens to have the same name, or similar, which we don't really expect to happen accidentally.
Member
There was a problem hiding this comment.
I guess, but we will still fallback to in-process csc invocation, so I think it still makes sense to not fail an Exec task for this, just like we wouldn't fail dotnet build.
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Mar 9, 2026
* upstream/main: (56 commits) [main] Source code updates from dotnet/dotnet (dotnet#82655) Update insert.yml to use roslyn-tools for insertions (dotnet#82615) Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2921538 Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2921538 Reduce allocations during source text diffing (dotnet#82462) Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2920904 Localized file check-in by OneLocBuild Task: Build definition ID 327: Build ID 2920904 Revert "Throw NotImplementedException when a build errorId is not supported" (dotnet#82638) [main] Source code updates from dotnet/dotnet (dotnet#82623) Revert System.ValueTuple version update (dotnet#82639) Pack enum values Track non-blocking PROTOTYPE comments for `Unions` feature in an issue (dotnet#82637) Update the build system errors instructions for Visual Studio 2026 Don't log named pipe connection failures as errors in BuildServerConnection (dotnet#82609) Fix resx source generator for less common resx metadata and locations (dotnet#81994) Disallow `ref` modifier for a union declaration (dotnet#82632) Add IFSharpInlineHintsService2 for displayAllOverride support (dotnet#82629) Report errors for union members that are not permitted (dotnet#82626) Check language version for union matching and conversions (dotnet#82617) [main] Update dependencies from dotnet/arcade (dotnet#82618) ...
This was referenced Mar 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When connecting to the compiler server fails due to a timeout, pipe ownership mismatch, or other exception, the previous
LogException/LogErrorcalls emitted messages prefixed with"Error Error:"or"Error:". This matches the canonical error pattern that MSBuild'sExectask detects in process output, causing it to surface a build error — even though these are transient, recoverable conditions where the compiler falls back gracefully to the command-line tool.Change
In
BuildServerConnection.cs, replaceLogException/LogErrorwith plainLogfor all three recoverable failure paths inTryConnectToServerAsync. Key diagnostic info (exception type + message) is retained; only the"Error:"prefix is dropped.LogException/LogErrorare appropriate for unexpected failures. These connection failures are all handled, recoverable conditions — logging them as errors was misleading.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.