Skip to content

[H/3] Do not close the connection before we process GO_AWAY / Abort - #111623

Merged
ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:h3-fix-go-away
Jan 21, 2025
Merged

ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:h3-fix-go-away

Conversation

@ManickaP

Copy link
Copy Markdown
Member

Do not close the connection before we set GO_AWAY stream id / close connection with proper code.

The detailed description of the race is in this comment: #111507 (comment)
TLDR:
If InvalidateHttp3Connection disposes the connection, it can get closed before setting the GO_AWAY _firstRejectedStreamId (or _abortException). In the meantime, Http3Connection.SendAsync will happily pass all checks and attempt to send the request, eventually failing on unexpected exception because neither _firstRejectedStreamId nor _abortException was set before QuicConnection.CloseAsync was called.

Fixes #111507

No additional tests, I wasn't able to reproduce this race. Fix is based on dump analysis and I'm checking that it didn't break any existing tests.

@ghost ghost added the area-System.Net.Http label Jan 20, 2025
@ManickaP ManickaP changed the title [h/3] Do not close the connection before we process GO_AWAY / Abort [H/3] Do not close the connection before we process GO_AWAY / Abort Jan 20, 2025
@ManickaP
ManickaP requested a review from a team January 20, 2025 14:53

@rzikm rzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ManickaP

ManickaP commented Jan 21, 2025 •

Copy link
Copy Markdown
Member Author

Failures:

  • runtime is known errors and covered by build analysis
  • stress linux is borked due to disk space, but windows passed
  • outerloop has a bit of failures so I check the http ones and they are only failures with H/2 and external server -> unrelated, but still I'm re-running the pipeline

@ManickaP
ManickaP merged commit 22c04fc into dotnet:main Jan 21, 2025
@ManickaP
ManickaP deleted the h3-fix-go-away branch January 21, 2025 15:48
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected exception type in Http3RequestStream.SendAsync: System.Net.Quic.QuicException: Operation aborted.

3 participants