镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

quic: Should QuicStream be destroyed, if onstream is not set #64192

Description

@martenrichter

Currently, incoming streams are destroyed, if the onstream callback is not set.
This sounds at first sight logically, however one can also use for http/3 onHeaders callback, later with webtransport support, it would be also onsessionid which is called for a webtransport data stream.
Then for http/3 onstream is most times pretty useless, as the other callbacks, which are opposed to the current docu are called later than onstream for h3 are more useful. So I have actually only stubs in onstream.

This is related to @pimterry api redesign (@jasnell may be also interested).

Activity

  1. added
    quicIssues and PRs related to the QUIC transport implementation.
    on Jun 28, 2026
  2. pimterry commented on Jun 29, 2026

    @pimterry
    Member

    Agreed - if we're exposing the stream via other APIs, it shouldn't mysteriously die if it's being used elsewhere. The invariant should be broader: if we get a stream, and it's not exposed at all (nothing listening to any relevant callback) then it should be cleaned up automatically so it's not left hanging. It's not really about the onstream callback specifically.

  3. trivenay commented on Aug 16, 2026

    @trivenay
    Contributor

    Opened #65335 implementing the invariant discussed here — an incoming stream is destroyed only when the session has no consumer at all for it: no onstream, and no session-level stream callbacks runnable on the negotiated application (checked via the existing headersSupported state). Stub onstream handlers are no longer needed to keep h3/WebTransport streams alive.

    Please take a look when you get a chance.

  4. trivenay commented on Aug 16, 2026

    @trivenay
    Contributor

    One related observation as a possible follow-up: per RFC 9114 §4.1.1, rejecting a request stream without processing it should signal H3_REQUEST_REJECTED so the client knows it is safe to retry. The destroy path currently sends the generic error code instead. If that sounds right, happy to pick it up as a small follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    quicIssues and PRs related to the QUIC transport implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions