Fix race in RST_STREAM_IncompleteRequest_AdditionalResetFrame test#65715
Merged
Fix race in RST_STREAM_IncompleteRequest_AdditionalResetFrame test#65715
Conversation
Move tcs.TrySetResult() after StopConnectionAsync so the response handler stays blocked until the connection has stopped. This prevents response HEADERS from being written before the GOAWAY frame, which caused the test to intermittently fail with 'Expected: GOAWAY, Actual: HEADERS'. This is the same fix pattern applied in #65454 for the sibling AdditionalDataFrames and AdditionalTrailerFrames tests, and in #57450 for the AdditionalWindowUpdateFrame test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts an HTTP/2 functional test in Kestrel to eliminate a race where the request delegate could complete early and emit response HEADERS before the test observes the expected GOAWAY frame.
Changes:
- Move
tcs.TrySetResult()to afterStopConnectionAsync(...)inRST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalResetto keep the request handler blocked until the connection stop/GOAWAY is observed.
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
11 tasks
adityamandaleeka
approved these changes
Mar 10, 2026
Wait for the request to be aborted before releasing the application delegate gate in RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset. This preserves the test intent while avoiding both the HEADERS-vs-GOAWAY race and the shutdown timeout.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DeagleGross
approved these changes
Mar 10, 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_AdditionalResetFrame_IgnoreAdditionalResettest.Problem
tcs.TrySetResult()was called beforeStopConnectionAsync, 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.Example failure from PR #65713 CI:
Fix
Move
tcs.TrySetResult()afterStopConnectionAsyncso the response handler stays blocked until the connection has stopped and the GOAWAY frame has been sent and verified.This is the same fix pattern applied in:
AdditionalDataFramesandAdditionalTrailerFramesAdditionalWindowUpdateFrameThis was the last remaining test in the
RST_STREAM_IncompleteRequestfamily with this race.