Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

flow-controlled client streams can be leaked when the server half-closes

Đang mở
#13,078 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
grpc, java

Hướng nghiên cứu

Start in NettyClientStream.java around the server half-close handling at lines 344-347, then trace AbstractClientStream.isOutboundClosed() and halfClose() under an exhausted control window. Run the standalone reproducer with ./gradlew run; done means completed client-streaming calls no longer leave HTTP/2 streams open or exhaust MAX_CONCURRENT_STREAMS.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When the server half-closes, NettyClientStream attempts to cancel the stream if the client has not half-closed: https://github.com/grpc/grpc-java/blob/4d0d548ea050d002c66573a30785f14bdfd41bea/netty/src/main/java/io/grpc/netty/NettyClientStream.java#L344-L347 However, AbstractClientStream.isOutboundClosed() reflects whether the application has called AbstractClientStream.halfClose() not whether the end-of-stream has actually been sent. The end-of-stream flag may never be sent if the control flow window is exhausted. This can prevent streams that would normally have terminated from ever dying.

A standalone reproduction of this bug is available at https://github.com/benjaminp/grpc_stream_leak_bug. The reproducer uses a client-streaming RPC. The client writes a large amount of data in a series of messages while the server implementation sleeps to allow the client to fill the control window and then replies with its unary response. Because of the bug, each call leaves the stream open. After making several calls, the client exhausts MAX_CONCURRENT_STREAMS and can no longer make calls.

$ ./gradlew run
> Task :run
client: launching server: leak-demo-client/bin/leak-demo-server
client: server pid=254266 port=38687
client: creating channel
client: call 0: sending 1064960 bytes
client: call 0: OK, server read 16384
client: call 1: sending 1064960 bytes
client: call 1: OK, server read 16384
client: call 2: sending 1064960 bytes
client: call 2: OK, server read 16384
client: call 3: sending 1064960 bytes
client: call 3: failed: Status{code=DEADLINE_EXCEEDED, description=CallOptions deadline exceeded after 4.999898215s. Name resolution delay 0.000000000 seconds. [closed=[], committed=[remote_addr=/127.0.0.1:38687]], cause=null}
client: call 4: sending 1064960 bytes
client: call 4: failed: Status{code=DEADLINE_EXCEEDED, description=CallOptions deadline exceeded after 4.999914485s. Name resolution delay 0.000000000 seconds. [closed=[], committed=[remote_addr=/127.0.0.1:38687]], cause=null}
client: call 5: sending 1064960 bytes
client: call 5: failed: Status{code=DEADLINE_EXCEEDED, description=CallOptions deadline exceeded after 4.999885146s. Name resolution delay 0.000000000 seconds. [closed=[], committed=[remote_addr=/127.0.0.1:38687]], cause=null}
BUG: 3 of 6 calls failed even though every earlier call completed OK; the completed calls' HTTP/2 streams were never closed and exhausted the server's MAX_CONCURRENT_STREAMS=3
Ngôn ngữ chính
Java
Star
12.1k
Fork
4k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
30

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của grpc/grpc-java

Tất cả issue của grpc/grpc-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.