Skip to content

fix(mux-h1): second keep-alive request to an H2 backend answered 502 #1781

Closed

Description

@FlorentinDUBOIS

With an H1 client in front of an H2 backend, the second request on a keep-alive client connection is answered 502: the backend's response HEADERS on the new stream is refused ("CANNOT RECEIVE Headers ON THIS STREAM") and the backend connection gets GOAWAY(STREAM_CLOSED). It happens with a backend that keeps its connection open as well as with one that closes it between the two requests.

ConnectionH1::writable reuses the client stream slot for the next request without clearing back_received_end_of_stream, front_received_end_of_stream and the per-direction DATA counters, which the H2 frontend clears when it recycles a slot. The stale end-of-stream flag makes the H2 backend connection treat the new stream as already closed (RFC 9113 §5.1).

Expected: the second request is forwarded and answered like the first.

Activity

  1. added 6 commits that reference this issue on Oct 1, 2026
    39e06f9
    2bfd353
    15d4bbc
    a2e88a4
    ae57426
    eb35f64
  2. added a commit that references this issue on Oct 2, 2026
    97c7f4c
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