[Named Pipe] Check for pipe broken on WaitConnectionAsync #46230
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.
Changes from #46182
I looked up situations that can cause a broken pipe and most sources mention a broken pipe can happen when the other side has disconnected. I'm unsure how that could apply to
WaitForConnectionAsync
because we're waiting for a client to connect. Perhaps the client can request a connection, then disconnect beforeWaitForConnectionAsync
returns the stream.No test, as I could not create a situation where a broken pipe exception was thrown.
@simonferquel I added logging because I'm wary of catching an error and continuing without any record of what is happening. If there is a situation where a server keeps getting broken pipes and goes into an infinite loop, there is logging to explain what the server is doing. I'm not sure if that can happen, just being cautious.