Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stopped recv stream flow control underflow under reordering #1869

Merged
merged 4 commits into from
May 22, 2024

Commits on May 19, 2024

  1. Fix stopped recv stream flow control underflow under reordering

    If frames are received out of order (e.g. due to packet loss) on a
    stopped stream, the local `end` might be less than the high water mark
    `Recv::end`. The previous code would set `Assembler::bytes_read` to
    that incorrect lower value, potentially after it had previously taken
    a higher value.
    
    If `MAX_STREAM_DATA` frames are then queued for that stream (e.g. due
    to retransmits prompted by packet loss), we might attempt to transmit
    a smaller flow control credit than we had previously. This would cause
    an underflow in the subtraction used to judge whether an increase in
    flow control credit is worth sending, and violates the spec besides.
    
    Because additional data on a stopped stream isn't useful, there's no
    benefit to updating stream-level flow control at all, so we might as
    well remove that path entirely. Connection-level flow control is still
    maintained at the StreamsState level based on change in the stream's
    high-water mark or determination of the final offset.
    Ralith committed May 19, 2024
    Configuration menu
    Copy the full SHA
    b529d6d View commit details
    Browse the repository at this point in the history
  2. Don't send stream-level flow control updates for stopped streams

    We only queue MAX_STREAM_DATA when stream data is read by the
    application, which never happens for stopped streams, but loss of
    packets carrying previously sent MAX_STREAM_DATA frames could still
    cause fresh ones to be queued unnecessarily. Filtering them out isn't
    strictly necessary, but saves some space in the packet.
    Ralith committed May 19, 2024
    Configuration menu
    Copy the full SHA
    825d646 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Configuration menu
    Copy the full SHA
    2da4907 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05423b3 View commit details
    Browse the repository at this point in the history