-
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
[HTTP/3] New case of "The server returned an invalid or unrecognized response" #57647
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsStarted happening after updating to I am able to (rarely) reproduce it by serially calling GET requests (harder to repro with Kestrel's logging enabled) HttpClient error looks like this
and related Kestrel log is
I think the problem might be tied to "the application completed without reading the entire request body". For the record, Kestrel's callback is set up like this var statuses = Enum.GetValues<HttpStatusCode>()
.Where(s => s >= HttpStatusCode.OK) // exclude informational
.Cast<int>().Distinct(); // remove dupes like Ambiguous(300) and MultipleChoices(300) to avoid ambiguous mapping
foreach (var status in statuses)
{
app.MapGet("/Expect" + status, () => {
Console.WriteLine("GET request to /Expect" + status + ", will return " + status + " " + (HttpStatusCode)status);
//return new StatusCodeResult(status);
return Results.StatusCode(status);
});
} and HttpClient's requests are using HttpClient client = CreateHttpClient();
var statuses = Enum.GetValues<HttpStatusCode>()
.Where(s => s >= HttpStatusCode.OK) // exclude informational
.Cast<int>().Distinct(); // remove dupes like Ambiguous(300) and MultipleChoices(300) to avoid ambiguous mapping
foreach (var status in statuses)
{
Console.WriteLine("Request expecting " + status + " " + (HttpStatusCode)status);
using HttpRequestMessage request = new()
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://localhost:5001/Expect" + status),
Version = HttpVersion30,
VersionPolicy = HttpVersionPolicy.RequestVersionExact
};
using HttpResponseMessage response = await client.SendAsync(request).WaitAsync(TimeSpan.FromSeconds(10));
if(status != (int)response.StatusCode)
{
fail = true;
Console.WriteLine(" FAILURE -- received " + (int)response.StatusCode + " " + response.StatusCode);
}
else
{
Console.WriteLine(" SUCCESS");
}
} cc @JamesNK
|
@JamesNK in what situation can "the application completed without reading the entire request body" happen? What does this mean and why the callback was not called? |
@CarnaViire could you in your test catch the exception from the client and continue sending additional requests? I'd like to confirm/deny my theory with another type of errors seen in the stress. |
I think this is an issue in Kestrel and will be fixed with dotnet/aspnetcore#35434
It happens if the request body isn't read until the end. The logs indicate you have started reading it, but not until the end. You can work around this bug by reading the request body in Kestrel until the end. Edit: Can also be caused by race condition with end stream flag. Should be resolved with addition of |
@ManickaP you are right. On the next request after |
Thanks for confirmation @CarnaViire, I filed another issue in ASP dotnet/aspnetcore#35470. |
To sum up, we expect this issue to get resolved after dotnet/aspnetcore#35434, |
@CarnaViire both issues are now merged. I guess we can close this issue and unblock our Stress. |
Today's stress run still has the issue ( |
I don't think so. It's 4 days old - dotnet/sdk#19917 |
The stress runs on that environment have used an older SDK over the last couple of days. You should investigate why and get it to use the latest SDK. |
We're running in the nightly docker image and that hasn't been updated yet, i.e.: https://github.com/dotnet/dotnet-docker/blob/nightly/src/runtime/6.0/bullseye-slim/amd64/Dockerfile |
This particular issue is fixed, H/3 stress runs for 30 mins, no occurrences of this error, closing. |
Addressed in 6.0, reflecting that in the milestone. |
Started happening after updating to
6.0.100-rc.1.21411.28
First noticed in stress tests here #57356 (comment)
But it is not specific to stress, neither to status code, so it is not the same as #55988
I am able to (rarely) reproduce it by serially calling GET requests (harder to repro with Kestrel's logging enabled)
HttpClient error looks like this
and related Kestrel log is
I think the problem might be tied to "the application completed without reading the entire request body".
Kestrel did not call my callback for that request. All the times the error happened without Kestrel's logging enabled, I've also seen that my callback was not called but HttpClient received some response which it couldn't read.
For the record, Kestrel's callback is set up like this
and HttpClient's requests are
cc @JamesNK
The text was updated successfully, but these errors were encountered: