flow-controlled client streams can be leaked when the server half-closes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- grpc, java
- Ambito
- backend-api-design, networking
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 3h
- PR unite (30g)
- 30
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di grpc/grpc-java
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
grpc/grpc-java#13063 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grpc/grpc-java#13052 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Support of `dns:name` URIsApertadocs enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
grpc/grpc-java#10824 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di grpc/grpc-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
refinedmods/refinedstorage2#1414 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
In Java's `LongBoundedSum`, setting `lower` to `Long.MIN_VALUE` under-estimates the sensitivityAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
google/differential-privacy#489 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
link-check link-check:manual
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100