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

Fix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded #89047

Conversation

antonfirsov
Copy link
Member

Fixes #88868.

@ghost
Copy link

ghost commented Jul 17, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #88868.

Author: antonfirsov
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

using HttpResponseMessage response = await SendAsync(client, request);
}).WaitAsync(timeout);
// Getting a cancellation is also good if we are unable to detect the peer shutdown.
using CancellationTokenSource cts = new CancellationTokenSource(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preferably, we should not use magic numbers. Can we find some known passing/failing constant? .

Copy link
Member Author

@antonfirsov antonfirsov Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only have TestHelper.PassingTestTimeoutMilliseconds = 60sec. This is too much, if we don't receive an RST from the server, I want the cancellation to fire relatively quickly while still making sure MetricsHandler is reached in the handler chain. Changed it to 10sec. I wasn't able to find a constant with similar semantics.

connection.Socket.Close();
try
{
var connection = (LoopbackServer.Connection)await server.EstablishGenericConnectionAsync().WaitAsync(20_000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be actually cancelled when the client request completes, changed the test.

@antonfirsov antonfirsov merged commit 6ae364d into dotnet:main Jul 18, 2023
103 checks passed
@karelz karelz added this to the 8.0.0 milestone Aug 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants