Skip to content

http2: Client can return partial response (instead of error emit)Β #35209

@kanongil

Description

@kanongil
  • Version: v14.10.1
  • Platform: macOS 10.15.6
  • Subsystem: http2

What steps will reproduce the bug?

  1. Setup a http2 server that will:
    a. Send a response containing a content-length header.
    b. Stall after transmitting part of the data (or just the headers).
    c. Stop the transmission with a RST_STREAM frame with error_code = 0.
  2. Create a http2 client (new or old api), and call the server, trying to receive the content.
  3. Validate that content-length bytes have been received.

FYI, I don't know how to setup such a server, though it can occur naturally with envoy in http2 mode.

How often does it reproduce? Is there a required condition?

100%. It requires the stream to be closed with a RST_STREAM frame containing error_code = 0.

What is the expected behavior?

http2 client emits an error.

What do you see instead?

No error. Just a partial response, with less than content-length bytes.

Additional information

This is caused by an nghttp2 bug: nghttp2/nghttp2#1508

The bug causes this callback to be called with code = NGHTTP2_NO_ERROR when the server sends a RST_STREAM frame with error_code = 0 for an active stream.

More details in my initial reported issue here: sindresorhus/got#1462

Metadata

Metadata

Assignees

No one assigned

    Labels

    http2Issues or PRs related to the http2 subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions