Skip to content

netty: Ignore inbound frames without a transport state - #13073

Open
NianJiuZst wants to merge 1 commit into
grpc:masterfrom
NianJiuZst:codex/netty-null-transport-state-13065
Open

NianJiuZst wants to merge 1 commit into
grpc:masterfrom
NianJiuZst:codex/netty-null-transport-state-13065

Conversation

@NianJiuZst

Copy link
Copy Markdown
Contributor

HEADERS and DATA callbacks dereference a null TransportState when the HTTP/2 stream exists without an associated gRPC stream, which can shut down the client connection. Ignore these headers and return the discarded DATA payload and padding to Netty's inbound flow controller. Keepalive still observes the received frames.

Add four regression tests that feed serialized frames through the decoder, covering headers, trailers, and DATA with and without END_STREAM. They check buffer release, consumed flow-control bytes, keepalive notifications, and continued delivery to another stream.

Fixes #13065.

Validation

  • The four new tests fail with the reported null dereference against upstream 9e0ff283e9a727546c46d889e02a9376c36ab411.
  • NettyClientHandlerTest: 63 tests passed after the fix.
  • Netty main/test Checkstyle and Animal Sniffer checks passed.
  • Full Netty suite on macOS with JDK 21: 574 passed, 79 skipped, and 2 timed out. NettyServerTest.multiPortConnections and NettyServerTest.connectionSettingsPropagated both also time out after 60 seconds at the same stack locations in a clean checkout of upstream 9e0ff283e. The full suite is not green locally.

The tests construct the missing-transport-state condition deterministically; they do not reproduce the original Pub/Sub startup race.

Guard HEADERS and DATA callbacks when the HTTP/2 stream has no associated
gRPC TransportState. Return discarded DATA payload and padding to the
inbound flow controller, and keep notifying keepalive for received frames.

Add decoder-level regression coverage for headers, trailers, and DATA
with and without END_STREAM, including buffer release and flow control.

Fixes grpc#13065.
@NianJiuZst
NianJiuZst marked this pull request as ready for review September 23, 2026 15:38
@AgraVator AgraVator added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Sep 28, 2026
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Sep 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in NettyClientHandler.onHeadersRead when a HEADERS frame races concurrent stream teardown

3 participants