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 race when receiving HEADERS and RST_STREAM in rapid succession. #72932

Conversation

rzikm
Copy link
Member

@rzikm rzikm commented Jul 27, 2022

Fixes #68373.

This PR makes requests made with HttpCompletionOption.ResponseHeadersRead finish successfully even if we receive RST_STREAM frame after successfully receiving response headers.

@ghost
Copy link

ghost commented Jul 27, 2022

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

Issue Details

Fixes #68373.

This PR makes requests made with HttpCompletionOption.ResponseHeadersRead finish successfully even if we receive RST_STREAM frame after successfully receiving response headers.

Author: rzikm
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@rzikm rzikm requested a review from MihaZupan July 27, 2022 10:52
@rzikm rzikm force-pushed the 68373-HTTP2-Possible-race-when-receiving-HEADERS-and-RST_STREAM-together branch from 258a0eb to 4f0e1c1 Compare July 27, 2022 10:53
@dotnet dotnet deleted a comment from azure-pipelines bot Jul 27, 2022
@rzikm
Copy link
Member Author

rzikm commented Jul 27, 2022

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -130,6 +130,19 @@ public async Task WriteFrameAsync(Frame frame, CancellationToken cancellationTok
await _connectionStream.WriteAsync(writeBuffer, 0, writeBuffer.Length, cancellationToken).ConfigureAwait(false);
}

public async Task WriteFramesAsync(Frame[] frames, CancellationToken cancellationToken = default)
Copy link
Member

Choose a reason for hiding this comment

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

This is just to make the test more likely to fail without the fix, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

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

@rzikm
Copy link
Member Author

rzikm commented Jul 28, 2022

Test failure is #72586

@rzikm rzikm merged commit a8789a6 into dotnet:main Jul 28, 2022
@karelz karelz added this to the 7.0.0 milestone Aug 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 6, 2022
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.

HTTP/2: Possible race when receiving HEADERS and RST_STREAM together
4 participants