Skip to content

HTTP3: Http3Stream is not removed from _activeRequests table until response Stream Dispose is called  #58072

Closed

Description

@geoffkizer

I found this by investigating other test issues...

The only place we call RemoveStream is when the user calls Dispose on the response Stream. That means that if they never call Dispose, we will be waiting potentially forever for GC to kick in and finalize the stream, and this will delay closing the connection.

We should instead remove the stream as soon as it is complete, i.e. request and response both fully sent/received or aborted. This is how HTTP/1.1 and HTTP2 work (I think).

Note this only matters when using HttpCompletionOption.ResponseHeadersRead.

You can reproduce this by cancelling the read on an incomplete response and then trying to shut down the server without disposing the response. See for example the GetAsync_CancelDuringResponseBodyReceived_Unbuffered_TaskCanceledQuickly test.

Activity

  1. ghost added
    untriaged
    on Aug 24, 2021
  2. karelz commented on Aug 26, 2021

    @karelz
    Member

    Triage: Useful as it addresses common user problem of not disposing response Stream. Limited to HttpCompletionOption.ResponseHeadersRead.
    Not critical for 6.0.

  3. added this to the 7.0.0 milestone on Aug 26, 2021
  4. added and removed
    untriaged
    on Aug 26, 2021
  5. self-assigned this
    on Jul 15, 2022
  6. ghost added
    in-pr
    on Jul 22, 2022
  7. ghost removed
    in-pr
    on Jul 26, 2022
  8. ghost locked as resolved and limited conversation to collaborators on Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions