Skip to content

Loss of STOP_SENDING frame's error code #1299

Done

Description

@masa-koz

Hello. In my understanding, a bidirectional stream will be collected when stream_recv() is called if the stream is complete. And, if an endpoint receives a STREAM including FIN and STOP_SENDING, then stream_recv() is called with an enough buffer, the stream will be collected. But I want to know the error code of the STOP_SENDING. Any idea?

Activity

  1. masa-koz commented on Aug 15, 2022

    @masa-koz
    Author

    In the above case, stream_send() will return Error::Done via get_or_create_stream() because the stream is collected. To determine whether an endpoint received a STOP_SENDING frame or not, I have to call stream_capacity(). But stream_send() should return Error::InvalidStreamState as stream_capacity() do, I think. Of course, returning Error:: StreamStopped is better.

  2. LPardue commented on Sep 19, 2022

    @LPardue
    Contributor

    Thanks for the report.

    IIUC to summarise, if an endpoint calls recv() to process packets and immediately uses some APIs, it can determine the STOP_SENDING error code. However, if it reads all of the stream data (or the stream was reset) it can no longer use any API to determine the STOP_SENDING error code.

    This seems like an annoying inconsistency. The challenge to fixing it is that we discard state for completed streams, so would need to figure out the best way to limited retain state to allow queries from the app.

  3. masa-koz commented on Sep 25, 2022

    @masa-koz
    Author

    I've tried to keep track of send error received via STOP_SENDING when the stream is collected.
    master...masa-koz:quiche:retain_state
    Does this make sense?

  4. added
    type: bugfix
    area: streams
    on Nov 24, 2026
  5. ghedo commented on Nov 25, 2026

    @ghedo
    Member

    Fixed by #2766 (d393d9c) and 6bf9adf, released in 0.30.1. A stream that received STOP_SENDING is now kept until the application sees the error, so stream_send() returns StreamStopped with the peer's code even after the receive side completes. The Done result on collected streams is tracked in #1695.

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

    area: streamstype: bugfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions