-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
unable to detect Socket.Send failures #101210
Comments
Tagging subscribers to this area: @dotnet/ncl |
To have the bytes transmitted immediately you should set
Hypothetically speaking: if socket send would need to report the error, it would have to block for at least a round trip to receive an acknowledgement from the peer. Also, this acknowledgement would be sent by the peer's kernel, so this doesn't tell the sender anything about how the peer is handling the data. What happens instead is that the acknowledgement is the responsibility of the application level protocol through replying back. For example: client sends HTTP POST, server sends back 200 OK. |
That will not help. The test is purposely structured in a way that TCP windows is filled (as server does not read data) so we can test behavior when data cannot be transmitted. I could not find any existing tests that would cover that behavior. |
Synchronous To stop the operation earlier users can set One way to know when the TCP window is full is calling |
Triage: Moving to the future, we will back to this once time permits. |
This is related to #99181 and #99490.
I wanted to write some test that fail predictably and I failed to do so.
So I decided to open this to capture some conversation
Let consider this
when I run it on my Windows 11 box everything finishes without error.
But looking at packet capture, we clearly did not sent 100K worth of data.
Same code throws on Linux. I thought it may be just timing so I did somewhat more elaborate test
this test is constructed to fill up socket buffers and TCP Window. The last Send succeeds as data are written to Socket buffer but not transmitted on the wire and ACKed back. (e.g. the 'B' block never goes out
Linux man page is pretty specific about it
it seems like our API does not allow us to check for the error and therefore I don't know how
Socket
users would know that data written toSocket
orNetworkStream
were actually lost.From what I can see this looks like silent data loss.
cc @tmds @antonfirsov @stephentoub for comments.
The text was updated successfully, but these errors were encountered: