runtime: H/2 stress many failure in content posting methods

Reproduces in and out of Docker. Started happening between 6.0 Preview 4 and 6.0 Preview 6 (on 4 it ran, on 6 started failing) - tested locally. Error:

System.Exception: Expected status code OK, got InternalServerError
   at HttpStress.ClientOperations.ValidateStatusCode(HttpResponseMessage m, HttpStatusCode expectedStatus) in /home/manicka/repositories/runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/ClientOperations.cs:line 487
   at HttpStress.ClientOperations.<>c.<<get_Operations>b__1_12>d.MoveNext() in /home/manicka/repositories/runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/ClientOperations.cs:line 451
--- End of stack trace from previous location ---
   at HttpStress.StressClient.<>c__DisplayClass17_0.<<StartCore>g__RunWorker|0>d.MoveNext() in /home/manicka/repositories/runtime/src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressClient.cs:line 204

Potentially kestrel error, cc: @JamesNK @Tratcher @halter73

Discovered in https://github.com/dotnet/runtime/pull/55098

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Can you please share instructions for how to run the stress test that reproduces this?

First, globally install the required SDK and runtime versions because stress tests use the globally installed .NET.

Then, in runtime repo:

  1. Go to the folder src/libraries/System.Net.Http/tests/StressTests/HttpStress
  2. Open ClientOperations.cs and comment out this if block in there. This if block currently suppresses the exceptions related to this issue.
  3. Open 2 console windows in this folder
  4. In the first window run the command to start server dotnet run -- -runMode server -serverUri https://+:5001
  5. In the second window, run the command to start client dotnet run -- -runMode client -serverUri https://localhost:5001 -ops 5 6 7 8 9 10 -maxContentLength 10000
  6. Watch the client’s output and wait for exceptions to be thrown and logged into the console

The test were disabled on 7/8, so that checks out 😉

@alnikola will you be able to run your repro easily against earlier version of Kestrel (either 5.0, or earlier 6.0 Preview)?

https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.6

A request or response that includes a payload body can include a content-length header field. A request or response is also malformed if the value of a content-length header field does not equal the sum of the DATA frame payload lengths that form the body.