[5.0] HTTP/2: Ignore additional RST_STREAM frames sent to stream #32478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
An HTTP/2 client sends multiple RST_STREAM frames for the same stream to Kestrel (this is a spec violation by the client, but the client's violation is exposing a violation in Kestrel)
If both RST_STREAM frames are read from the transport at the same time, Kestrel is incorrectly killing the collection. Kestrel is violating the HTTP/2 specification.
The correct logic is to ignore the second RST_STREAM frame. PR corrects that logic.
This PR takes the changes in #32449 and backports them to 5.0
Customer Impact
Customer using gRPC Java client to call Kestrel. Kestrel is ending the connection when this bug occurs, causing the customer app to break.
#32449 (comment)
It is unlikely that this bug impacts many people. An HTTP/2 client that violates the spec and the right situation is required to encounter it.
Regression?
[If yes, specify the version the behavior has regressed from]
Risk
Low risk. The connection error on receiving the second RST_STREAM frame is replaced with an ignore. This makes Kestrel match the HTTP/2 spec.
Verification
Manually verifying this would be tough. It would require setting up Java client and replicating its code. Might need to ask the customer to retest with 6.0 daily build that contains the fix.
Update: Customer has verified fix using .NET 6 - #32478 (comment)
Packaging changes reviewed?
Addresses #32442