sdk-http-vertx: response writes ignore Vert.x backpressure
まだ誰も着手していません。
評価
調査の方向性
HttpResponseFlowAdapter.onSubscribe と onNext から始め、次に Vert.x WriteStream の backpressure コントラクトとその Pump ヘルパーを比較します。Response の生成量に上限を設け、writeQueueFull() が true のときは request を一時停止し、drainHandler を通じて再開します。対応する queue の上限については HttpRequestFlowAdapter.handleIncomingBuffer を確認してください。
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- Java
- スター
- 60
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
restatedev/sdk-java のほかの issue
-
Vert.x 5 update オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
restatedev/sdk-java#629 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
restatedev/sdk-java#603 ·
-
restatedev/sdk-java#570 · 担当者 1 名 ·
-
dependencies
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
restatedev/sdk-java#569 · コメント 2 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
restatedev/sdk-java#555 · コメント 1 件 ·
restatedev/sdk-java の issue をすべて見る
似ている issue
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/rocketmq-dashboard#5064 ·