Skip to content
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

[Named Pipe] Check for pipe broken on WaitConnectionAsync #46230

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 24, 2023

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 before WaitForConnectionAsync 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.

@simonferquel
Copy link
Contributor

Logging seem a good idea. On our own reliability tests at Unity (where we have a similar custom Listener implementation), we encounter broken pipes on WaitForConnection under sustained high load (e.g. a few minutes of both CPU and memory high usage).
Also something we do on client-side before connecting, is to use File.Exists("\\\\.\\pipe\\{namedPipeOrUnixSocket}") to check of the server side existence.

@JamesNK JamesNK merged commit 6af56b8 into main Jan 25, 2023
@JamesNK JamesNK deleted the namedpipe/catch-io-exception-on-accept-async-new branch January 25, 2023 01:58
@ghost ghost added this to the 8.0-preview1 milestone Jan 25, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants