-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded #89047
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #88868.
|
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); |
There was a problem hiding this comment.
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? .
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
There was a problem hiding this comment.
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.
Fixes #88868.