Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[release/3.0] HTTP2: Rework shutdown handling - #39775

Merged
geoffkizer merged 7 commits into
dotnet:release/3.0from
geoffkizer:port39638
Jul 25, 2019
Merged

geoffkizer merged 7 commits into
dotnet:release/3.0from
geoffkizer:port39638

Conversation

@geoffkizer

@geoffkizer geoffkizer commented Jul 25, 2019 •

Copy link
Copy Markdown

Fixes #39630
Fixes #39624
Incomplete attempt to fix #39586
Fixes #39461
Fixes #39460
Fixes #39458
Fixes #39459
Fixes #39404

Port of #39638 from master to release/3.0.

Rework shutdown handling to be reliable and consistent, for both streams and connections.

Each Http2Stream has to complete both request and response before shutting down, at which time it will remove itself from the stream dictionary and clean up associated state.

The request body and response body can each be cancelled, and these are now cancelled at appropriate times (e.g. Dispose on response stream before reading to end).

The behavior of early non-success status codes is changed to not cancel the request body. This matches HTTP/1.1 behavior.

The connection is now shut down only when all streams are removed from the dictionary. Receiving EndStream or RST_STREAM does not automatically remove the stream; instead we let the stream manage its own shutdown and then remove it from the dictionary.

Add relevant tests, fix up some existing tests, and remove one bogus test.

I haven't run stress tests on this yet -- I wanted to get the review out first. Will report when I have stress results.


@danmosemsft

Note: #39745 will need to go into release/3.0 too. It's currently blocked on eng system issues. If these get resolved, I will add to this PR. Can you approve that fix too?

@danmoseley

Copy link
Copy Markdown

Approved - stress. Have we hammered enough on this using the stress app in master? @eiriktsarpalis any concerns about putting this into 3.0 today?

@geoffkizer

Copy link
Copy Markdown
Author

I ran stress on this for about an hour locally, against http.sys. Zero failures, which is much better than previous results.

@danmoseley

Copy link
Copy Markdown

Sounds good to me. Please go ahead.

@danmoseley
danmoseley requested a review from stephentoub July 25, 2019 18:32
@ahsonkhan

Copy link
Copy Markdown

Friendly reminder: please remember to squash commits when merging in the future (using the "Squash and merge" button on GitHub). Thanks.

@karelz karelz changed the title Port fix for 39638 to release/3.0 [release/3.0] HTTP2: Rework shutdown handling Aug 3, 2019
@karelz karelz added this to the 3.0 milestone Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants