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 potential Debug.Assert in QuicListener #103965

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

rzikm
Copy link
Member

@rzikm rzikm commented Jun 25, 2024

Fixes #103911.

The reason the crash happened is that both linkedCts and connection.ConnectionShutdownToken fired. The code checked ConnectionShutdownToken first, assuming that the connection close because peer closed it during the handshake, but the reason for the exception was actually because the HandshakeTimeout ran out, so the control flow shouldn't have entered that catch block in the first place.

Checking that linkedCts has not been signalled yet eliminates the race.

Copy link
Contributor

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

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM

@wfurt
Copy link
Member

wfurt commented Jun 25, 2024

can we craft test that would cause the timeout predictably?

@rzikm
Copy link
Member Author

rzikm commented Jun 25, 2024

can we craft test that would cause the timeout predictably?

we have a test for timeouts, but this the failure happened because the timeout ran out at the same time we got connection shutdown notification from MsQuic so it was effectively a data race. I don't see a way to craft a test for this (I tested this by adding extra waits and other changes to trigger the exact failure condition).

@rzikm
Copy link
Member Author

rzikm commented Jun 26, 2024

/ba-g failures are either known or unrelated (wasm library build errors)

@rzikm rzikm merged commit 2fab73c into dotnet:main Jun 26, 2024
72 of 83 checks passed
rzikm added a commit that referenced this pull request Jun 28, 2024
rzikm added a commit that referenced this pull request Jun 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2024
@karelz karelz added this to the 9.0.0 milestone Sep 3, 2024
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.

Process terminated. Assertion failed. in System.Net.Http.Functional.Tests
4 participants