Fix race in RST_STREAM_IncompleteRequest HTTP/2 tests#65454
Merged
adityamandaleeka merged 1 commit intodotnet:mainfrom Feb 18, 2026
Merged
Fix race in RST_STREAM_IncompleteRequest HTTP/2 tests#65454adityamandaleeka merged 1 commit intodotnet:mainfrom
adityamandaleeka merged 1 commit intodotnet:mainfrom
Conversation
Move tcs.TrySetResult() after WaitForConnectionErrorAsync to prevent the response HEADERS from racing with the GOAWAY frame. Same fix pattern as dotnet#57450 applied to AdditionalDataFrames and AdditionalTrailerFrames variants.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition in two HTTP/2 test methods where response headers could be written before the GOAWAY frame, causing test failures. The fix moves tcs.TrySetResult() to occur after WaitForConnectionErrorAsync, ensuring the response handler remains blocked until the connection error has been properly validated.
Changes:
- Move
tcs.TrySetResult()afterWaitForConnectionErrorAsyncinRST_STREAM_IncompleteRequest_AdditionalDataFrames_ConnectionAborted - Move
tcs.TrySetResult()afterWaitForConnectionErrorAsyncinRST_STREAM_IncompleteRequest_AdditionalTrailerFrames_ConnectionAborted - Add clarifying comments explaining the timing requirement
BrennanConroy
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix race condition in
RST_STREAM_IncompleteRequest_AdditionalDataFrames_ConnectionAbortedandRST_STREAM_IncompleteRequest_AdditionalTrailerFrames_ConnectionAbortedtests.Problem
tcs.TrySetResult()was called beforeWaitForConnectionErrorAsync, allowing the request handler to complete and write response HEADERS into the output pipe before the GOAWAY frame. SinceignoreNonGoAwayFrames: false, the test fails when it reads HEADERS instead of GOAWAY.Fix
Move
tcs.TrySetResult()afterWaitForConnectionErrorAsyncso the response handler stays blocked until the GOAWAY has been sent and verified. This is the same fix pattern applied in #57450 for the analogousAdditionalWindowUpdateFrametest.