flow-controlled client streams can be leaked when the server half-closes
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
- Lĩnh vực
- backend-api-design, networking
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của grpc/grpc-java
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
grpc/grpc-java#13052 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Support of `dns:name` URIsĐang mởdocs enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
grpc/grpc-java#10824 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của grpc/grpc-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
checkstyle/checkstyle#21755 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/copilot-sdk#2782 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make docs website more visibleĐang mởdocumentation Good for newcomer quick win
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CodeForPhilly/benefit-decision-toolkit#519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-deployment triage:bot-seen triage:needs-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/aspire#20533 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày