Skip to content

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

Merged
rzikm merged 2 commits intodotnet: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 intodotnet:mainfrom
rzikm:68373-HTTP2-Possible-race-when-receiving-HEADERS-and-RST_STREAM-together

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

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