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

[HTTP/3] Better handle connection close by browser #37835

Open
JamesNK opened this issue Oct 26, 2021 · 1 comment
Open

[HTTP/3] Better handle connection close by browser #37835

JamesNK opened this issue Oct 26, 2021 · 1 comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions HTTP3
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented Oct 26, 2021

When a browser is closed it shuts down the QUIC transport rather than aborting. That leaves unidirection control streams in an unhealthy state.

  • Need to shutdown the connection with the minimum of errors and error logging.
  • Skip writing GOAWAY frame if the transport is dead

We need to know whether a connection was aborted or shutdown which will require work in System.Net.Quic.

Example logs from browser close:

[13:45:13.266] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#258006,NativeCallbackHandler,[conn][0x21660D75020] Connection received event SHUTDOWN_INITIATED_BY_TRANSPORT ->
[13:45:13.267] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#9010854,HandleEvent,[strm][0x21660D762E0] Stream received event SHUTDOWN_COMPLETE ->
[13:45:13.267] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#9010854,HandleEventConnectionClose,[strm][0x21660D762E0] Stream handling connection [conn][0x21660D75020] close with code 0 ->
[13:45:13.290] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#16802227,HandleEvent,[strm][0x2166102F510] Stream received event SEND_SHUTDOWN_COMPLETE ->
[13:45:13.290] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#16802227,HandleEvent,[strm][0x2166102F510] Stream received event SHUTDOWN_COMPLETE ->
[13:45:13.290] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#16802227,HandleEventConnectionClose,[strm][0x2166102F510] Stream handling connection [conn][0x21660D75020] close with code 0 ->
[13:45:13.291] dbug: HttpEventSourceListener[0]
      <- Event Private.InternalDiagnostics.System.Net.Quic - Info : State#258006,NativeCallbackHandler,[conn][0x21660D75020] Connection received event SHUTDOWN_COMPLETE ->
[13:45:13.291] dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Quic[11]
      Stream id "0HMCO37DOFV64:00000002" read aborted by peer with error code 0.
[13:45:13.292] dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Quic[12]
      Stream id "0HMCO37DOFV64:00000003" write aborted by peer with error code 0.
[13:45:13.292] dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Quic[10]
      Stream id "0HMCO37DOFV64:00000003" shutting down writes because: "Connection aborted by peer (0).".
[13:45:13.273] dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Quic[5]
      Connection id "0HMCO37DOFV64" aborted by peer with error code 0.
      System.Net.Quic.QuicConnectionAbortedException: Connection aborted by peer (0).
         at System.Net.Quic.Implementations.MsQuic.MsQuicConnection.AcceptStreamAsync(CancellationToken cancellationToken)
         at System.Net.Quic.QuicConnection.AcceptStreamAsync(CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal.QuicConnectionContext.AcceptAsync(CancellationToken cancellationToken) in C:\Development\Source\AspNetCore\src\Servers\Kestrel\Transport.Quic\src\Internal\QuicConnectionContext.cs:line 97
@ghost
Copy link

ghost commented Sep 28, 2022

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
@amcasey amcasey modified the milestones: .NET 8 Planning, Backlog Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions HTTP3
Projects
None yet
Development

No branches or pull requests

3 participants