Skip to content

Fix race when receiving HEADERS and RST_STREAM in rapid succession.#72932

Merged
rzikm merged 2 commits into
dotnet:mainfrom
rzikm:68373-HTTP2-Possible-race-when-receiving-HEADERS-and-RST_STREAM-together
Jul 28, 2022
Merged

Fix race when receiving HEADERS and RST_STREAM in rapid succession.#72932
rzikm merged 2 commits into
dotnet:mainfrom
rzikm:68373-HTTP2-Possible-race-when-receiving-HEADERS-and-RST_STREAM-together

Conversation

@rzikm

@rzikm rzikm commented Jul 27, 2022

Copy link
Copy Markdown
Member

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 ghost added the area-System.Net.Http label Jul 27, 2022
@ghost ghost assigned rzikm Jul 27, 2022
@ghost

ghost commented Jul 27, 2022

Copy link
Copy Markdown

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

rzikm commented Jul 27, 2022

Copy link
Copy Markdown
Member Author

/azp run runtime-libraries-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

await _connectionStream.WriteAsync(writeBuffer, 0, writeBuffer.Length, cancellationToken).ConfigureAwait(false);
}

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

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.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes

@wfurt wfurt 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

@rzikm

rzikm commented Jul 28, 2022

Copy link
Copy Markdown
Member Author

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