runtime: Socket connection hangs on Linux when buffers aren't read fully before closing connection

On windows 10 works perfectly. On ubuntu16 hangs every time. dotnet 1.0.0-preview2-1-003177

command to reproduce (every time) at the following links :

dotnet test src/FastTests -class FastTests.Server.OAuth.CanAuthenticate -verbose

At first I used WebSocket and the connection hanged. Repro every time at: https://github.com/ravendb/ravendb/commit/1990e41e4da8d3b97e4ba98714028ac27eb9f514

While thinking this is a websocket problem, I changed the code to use http requests, but it still hangs in the same way. Only when I drains the buffers it passes: https://github.com/ravendb/ravendb/commit/d8f4aec4561e51db50b739288b520b8121e45a22

The last commit needed only in Linux. In windows it works fine.

My suspect is websocket disconnections timeouts and hangs on linux are related to the above bug, and solving it for http requests will help also with websockets.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (18 by maintainers)

Most upvoted comments

@cesarbs, thanks for the help investigating, and for the fix in https://github.com/aspnet/KestrelHttpServer/issues/1537. We also discussed whether we should use the new libcurl CURLOPT_KEEP_SENDING_ON_ERROR flag if it’s available, and decided that doing so is not a good idea (e.g. continuing to send large post data even if the server has already said it’s not interested, such as due to a redirect or auth or some other error status). As such, I’m going to close this out.