Skip to content

fix(h2): backend stream answered before its request was written is left open on the backend #1734

Closed

Description

@FlorentinDUBOIS

When an H2 backend stream ends, ConnectionH2::end_stream (Position::Client arm, lib/src/protocol/mux/h2.rs) skips the RST_STREAM when back_received_end_of_stream && front.is_terminated(). That condition checks that the request was received whole from the client, not that it was written whole to the backend.

A backend may send a complete response before the whole request reached it (RFC 9113 §8.1), for example while the rest of the body waits on the stream's send window. If the stream then ends, sozu drops it without sending the rest of the request and without a reset. The backend never sees END_STREAM, so the stream stays half-closed on its side and counts against its SETTINGS_MAX_CONCURRENT_STREAMS (RFC 9113 §5.1.2) for as long as the connection lives. Sozu's own slot is released, so the two views drift apart.

The stream should be reset with RST_STREAM(CANCEL) unless the request's END_STREAM was also handed to the output.

Activity

  1. added 2 commits that reference this issue on Oct 1, 2026
    b0cd491
    f6e7cb4
  2. added a commit that references this issue on Oct 2, 2026
    006d255
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions