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

[release/3.0] HTTP2: Fix hang due to handling of RST_STREAM with error = NO_ERROR after response EndStream - #40112

Merged
danmoseley merged 1 commit into
dotnet:release/3.0from
geoffkizer:port39882
Aug 8, 2019
Merged

danmoseley merged 1 commit into
dotnet:release/3.0from
geoffkizer:port39882

Conversation

@geoffkizer

@geoffkizer geoffkizer commented Aug 7, 2019 •

Copy link
Copy Markdown

Fixes #39586
Fixes #40030

Port of #39882 to release/3.0

Description

The RFC defines special behavior for receiving a RST_STREAM with error = NO_ERROR after the response body stream has been completed. When this happens, a client is supposed to cancel sending the request body but still consider the request successful. Previously, we did not do this.

Impact

Fixes a hang found in gRPC scenarios. Also affects non-GRPC scenarios, e.g. POST and receive early 4xx response like Forbidden; many servers will send RST_STREAM with NO_ERROR in this scenario.

Regression?

No

Risk

Low

@danmosemsft

…e EndStream (dotnet#39882)

* fix handling of RST_STREAM with error = NO_ERROR after response EndStream

* eat exception and ensure we don't cancel the response body

* add comment

* add CancelResponseBody to avoid code duplication, and add checks we are not holding the stream object lock when we don't expect to

* fix _expect100ContinueWaiter to use TaskCreationOptions.RunContinuationsAsynchronously
@davidsh

davidsh commented Aug 7, 2019

Copy link
Copy Markdown
Contributor

@geoffkizer We've deprecated the label "area-System.Net.Http.SocketsHttpHandler". @karelz (or perhaps @stephentoub) moved all those issues/PRs to use "area-System.Net.Http" label.

I see you added back the label. I am going to switch it back to System.Net.Http area.

@geoffkizer

Copy link
Copy Markdown
Author

I see you added back the label.

The bot actually added it originally, so the bot needs to get fixed. I was trying to add it manually but the bot added it first, and then I got confused and removed it instead of adding it :) So then I re-added it.

@stephentoub

Copy link
Copy Markdown
Member

or perhaps @stephentoub

Yeah, it was me. I was getting frustrated with having two labels for the same thing, and Karel agreed we could do it at the end of last month, so I did :)

@davidsh

davidsh commented Aug 7, 2019

Copy link
Copy Markdown
Contributor

The bot actually added it originally, so the bot needs to get fixed. I was trying to add it manually but the bot added it first, and then I got confused and removed it instead of adding it :) So then I re-added it.

@dotnet/dnceng Can we change the 'bot' so that it won't create/use the (now deleted) "area-System.Net.Http.SocketsHttpHandler" label? It should use "area-System.Net.Http" label instead.

@danmoseley

danmoseley commented Aug 7, 2019 •

Copy link
Copy Markdown

@maryamariyan currently owns the bot. Maryam this label has been deleted so we don't want it...

  1. Hack the code so that when it predicts area-System.Net.Http.SocketsHttpHandler it instead applies area-System.Net.Http. Short term solution at best..
  2. Retrain it - since I see someone already removed all use of that label

@maryamariyan

Copy link
Copy Markdown

@danmosemsft alright, noted!

@danmoseley
danmoseley requested a review from a team August 7, 2019 21:08
@danmoseley danmoseley changed the title [release/3.0] HTTP2: Fix handling of RST_STREAM with error = NO_ERROR after response EndStream [release/3.0] HTTP2: Fix hang due to handling of RST_STREAM with error = NO_ERROR after response EndStream Aug 8, 2019
@danmoseley

Copy link
Copy Markdown

tactics approved

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.

6 participants