sdk-http-vertx: response writes ignore Vert.x backpressure
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Inizia da HttpResponseFlowAdapter.onSubscribe e onNext, quindi confronta il contratto di backpressure di Vert.x WriteStream con il relativo helper Pump. Rendi limitata la produzione delle response, metti in pausa le request quando writeQueueFull() è true e riprendile tramite drainHandler; esamina HttpRequestFlowAdapter.handleIncomingBuffer per il limite corrispondente della coda.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
HttpResponseFlowAdapter in sdk-http-vertx ignores Vert.x's write-side backpressure on the HTTP/2 response stream:
onSubscribepulls unboundedly:this.outputSubscription = subscription; this.outputSubscription.request(Long.MAX_VALUE);onNextwrites each slice unconditionally:
No check onthis.httpServerResponse.write( Buffer.buffer(Unpooled.wrappedBuffer(slice.asReadOnlyByteBuffer())));HttpServerResponse.writeQueueFull(), nodrainHandler(...)to resume.
The Reactive-Streams contract and Vert.x's own WriteStream docs both expect callers to throttle production when writeQueueFull() returns true. The adapter throws away that signal.
Observed evidence
While investigating a separate e2e issue, instrumentation on the SDK side recorded writeQueueFull=true on the very first response writes under a 50-concurrent ctx.run × 10×64 KiB workload (Restate runtime as the peer). That confirms the writeQueue does cross Vert.x's high-watermark threshold in realistic Restate workloads — the adapter just keeps writing past it.
(We did not observe SDK-side heap growth or autoRead toggling in that test, so this issue is a code-correctness / future-proofing fix rather than the cause of the failure we were chasing.)
Proposal
Apply standard Reactive-Streams + Vert.x backpressure to HttpResponseFlowAdapter:
- Replace
request(Long.MAX_VALUE)with a bounded initial request (e.g.request(N)). - In
onNext, after writing, checkhttpServerResponse.writeQueueFull():- If full, do not call
subscription.request(...); instead installhttpServerResponse.drainHandler(v -> subscription.request(M))to resume. - If not full, request the next batch immediately.
- If full, do not call
- This is the same pattern Vert.x's own
Pumphelper implements.
Companion (lower priority, same class of bug)
The request side has an analogous unbounded enqueue: HttpRequestFlowAdapter.handleIncomingBuffer pushes incoming buffers into an ArrayDeque<ByteBuffer> without an upper bound. Worth bounding while we're in the same module.
Files
sdk-http-vertx/src/main/java/dev/restate/sdk/http/vertx/HttpResponseFlowAdapter.javasdk-http-vertx/src/main/java/dev/restate/sdk/http/vertx/HttpRequestFlowAdapter.java(companion)
- Lingua principale
- Java
- Stelle
- 60
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 restatedev/sdk-java
-
Vert.x 5 updateAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
restatedev/sdk-java#629 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
restatedev/sdk-java#603 ·
-
Reflection based experienceForse di nuovo libera @slinkydeveloper l’ha presa 265 giorni fa e non c’è nessuna pull request aperta. Aperta
restatedev/sdk-java#570 · 1 assegnatario ·
-
dependencies
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
restatedev/sdk-java#569 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
restatedev/sdk-java#555 · 1 commento ·
Tutte le issue di restatedev/sdk-java
Issue simili
-
P2 testing
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
area/core kind/bug status/triage team/core-shared
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
checkstyle/checkstyle#21755 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
spring-projects/spring-integration#11495 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno