From fb9a10809f5106333f447fe0cda1c761d5846f72 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 22 Apr 2024 10:27:39 -0700 Subject: [PATCH] netty: Release SendGrpcFrameCommand when stream is missing (#11116) `sendGrpcFrame` owns the buffer in `SendGrpcFrameCommand`. If the frame is not handed off to netty, it needs to be released in the method. https://github.com/grpc/grpc-java/issues/11115 --- netty/src/main/java/io/grpc/netty/NettyServerHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java index 500368e880f..77b448446b1 100644 --- a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java +++ b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java @@ -748,6 +748,7 @@ private void sendGrpcFrame( int streamId = cmd.stream().id(); Http2Stream stream = connection().stream(streamId); if (stream == null) { + cmd.release(); streamGone(streamId, promise); return; }