Skip to content

http2: a handler that answers past the client's window without reading its body hangs a client that uploads everything before it reads #588

Closed as not planned

Description

@MDA2AV

Some clients finish their upload before they read the response. A handler that answers such a client with more than its stream window, without reading the request body, hangs until the client times out. .NET's HttpClient does this when it uploads a StreamContent, which is not duplex. Seen with a 256 KiB streamed 413 over h2c, both before and after #582.

Cause. The unread body holds the 65,535-byte connection window, so the upload stalls. The client credits the response only after its upload ends, so the response never reaches END_STREAM. #582's reset waits for END_STREAM, so it never goes out either.

Fix. Credit and drop the body of a request whose handler has returned, before its response ends, so that the upload can finish. A connection window larger than 65,535 (#569) would only move the threshold. #582's E2E test keeps its h2 answer inside the window for this reason.

Seen while fixing #571 (#582).

Activity

  1. MDA2AV commented on Nov 15, 2026

    @MDA2AV
    OwnerAuthor

    Closing as not planned. A client that reads its response only after it has sent its whole request (.NET HttpClient with a non-duplex content, for one) and gets an early answer larger than its stream window waits until its own timeout, as it would with nginx or Go: the server won't drain its upload to rescue it. A client that reads while it uploads, which hung because nothing told it to stop, is handled by #633, which sends RST_STREAM(NO_ERROR) after such an answer; early answers that fit the client's window already got one.

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

    bugSomething isn't workingseverity:mediumPerf cliff / hardening gap

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions