You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HTTP/3] Connection not closed when client is disposed? #56766
Uses HttpClient to call Kestrel (this creates a QUIC connection)
Disposes HttpClient (expect QUIC connection to be closed)
I expected that step 3 would trigger the client to send a GOAWAY and close the connection, and the server to receive a notification. The server has a pending call on AcceptStreamAsync that should throw. Instead, the connection stays open and the server patiently waits.
I wrote a test that uses QuicConnection directly and the expected abort happened on the server when the client called QuicConnection.CloseAsync.
using(varhost=builder.Build()){awaithost.StartAsync();varclient=CreateClient();try{varport=host.GetPort();// Actvarrequest1=newHttpRequestMessage(HttpMethod.Get,$"https://127.0.0.1:{port}/");request1.Version=HttpVersion.Version30;request1.VersionPolicy=HttpVersionPolicy.RequestVersionExact;varresponse1=awaitclient.SendAsync(request1);response1.EnsureSuccessStatusCode();awaitconnectionStartedTcs.Task.DefaultTimeout();}finally{Logger.LogInformation("Disposing client.");client.Dispose();}Logger.LogInformation("Waiting for server to receive connection close.");awaitconnectionClosedTcs.Task.DefaultTimeout();awaithost.StopAsync();}
Activity
wfurt commentedon Aug 3, 2021
no pending requests? AFAIK HttpClient would keep active response streams alive even after disposal.
JamesNK commentedon Aug 3, 2021
There is a pending request. I'll check if that is the reason.No, there isn't a pending request.
JamesNK commentedon Aug 3, 2021
Maybe the client thinks the request has a response body (it doesn't) and is waiting for app code to finish reading it?
geoffkizer commentedon Aug 3, 2021
We are just missing this logic currently. I have a fix, will post a PR soon-ish.
geoffkizer commentedon Aug 6, 2021
Fixed by #56943