Skip to content

HTTP2: Race between response body Dispose and request body completion  #30393

Closed
dotnet/corefx
#39834

Description

@geoffkizer

Found during GRPC stress.

If the client finishes sending the request body at approximately the same time that it disposes the response body without reading to the end, then there's a race between sending EndStream for the request body and RST_STREAM caused by the dispose. If the RST_STREAM ends up getting sent first, then this is a protocol violation.

Activity

  1. self-assigned this
    on Jul 26, 2019
  2. geoffkizer commented on Jul 27, 2019

    @geoffkizer
    ContributorAuthor

    @eiriktsarpalis For HttpStress to try to induce this, it would try to do something like this:

    Create a duplex stream, send some data, have the server send some data too but don't read it on the client, then (a) Dispose the response body and (b) immediately complete the request body.

  3. eiriktsarpalis commented on Jul 29, 2019

    @eiriktsarpalis
    Member

    Create a duplex stream, send some data, have the server send some data too but don't read it on the client, then (a) Dispose the response body and (b) immediately complete the request body.

    @geoffkizer I created such a test case, and was able to consistently reproduce a small percentage of errors with the latest nightly. Confirming however that building off latest master made all errors go away.

  4. karelz commented on Aug 3, 2019

    @karelz
    Member

    Waiting on merge of dotnet/corefx#39874 to make it into 3.0. Reopening.

    The bug was fixed in master (5.0) in PR dotnet/corefx#39834.
    Port to release/3.0 is pending in PR dotnet/corefx#39874.

  5. reopened this on Aug 3, 2019
  6. karelz commented on Aug 9, 2019

    @karelz
    Member

    Fixed in 3.0 by PR dotnet/corefx#39874 and in master (5.0) in PR dotnet/corefx#39834

  7. transferred this issue fromdotnet/corefxon Feb 1, 2020
  8. added this to the 3.0 milestone on Feb 1, 2020
  9. ghost locked as resolved and limited conversation to collaborators on Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Httptenet-reliability

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions