Support stream-level rebalancing for long-running RPCs (MaxStreamAge)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- grpc, java
調査の方向性
A9 のサーバー側接続管理提案と、keepalive.go および internal/transport/http2_server.go に関する grpc-go の参照から始めます。次に、issue では名前が挙げられていない grpc-java のストリームのライフサイクルとエラーハンドリングのエントリーポイントを確認します。完了条件は、grpc-java と grpc-go の jitter、終了ステータス、リトライ動作、機能パリティを対象とする、承認済みの gRFC 設計です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem?
At our scale (1000+ client streams across 150 servers), long-running streaming RPCs (VStream CDC, Pub/Sub, Bigtable watch) create a load balancing problem with ORCA metrics. Using MaxConnectionAge causes connection churn for idle streams that only receive ORCA metrics. We need per-stream lifecycle management for efficient L7 load balancing.
The problem is that each server or client gRPC stream must implement its own stream termination logic in order to effectively use ORCA metrics and L7 load balancing. See best practices mentioned in https://github.com/grpc/grpc-java/issues/12525#issuecomment-3564341605.
Describe the solution you'd like
Similar to server-side connection management (gRPC A9) with MaxConnectionAge & MaxConnectionGrace for L4 load balancers, we propose adding a MaxStreamAge. Note we intentionally do not add grace since MaxConnectionGrace can be used to terminate with a graceful and forceful signal, while vstream is terminated the same either way (with error).
- terminate a stream after the given age (with jitter to avoid thundering herd)
- work at L7 (stream level) instead of L4 (connection level)
- allow orca metrics to continue flowing on the connection
- send an error code that clients could handle and immediately retry on the connection (possibly connecting to another server based on gRPC metrics)
This would prevent every application from re-implementing the same interval/jitter/status logic for long-running streams.
Describe alternatives you've considered
- MaxConnectionAge: Inefficient with L7 LB; closes connection even for idle ORCA streams
- Client-side timers: Every client must implement jitter/retry logic differently
- Server-side timers: Requires custom code per service (repeated development effort); no standard status codes
- MaxConnectionIdle: Only triggers when ALL streams are idle, not per-stream
Additional context
Our production environment uses:
- Server: grpc-go (Vitess vttablet)
- Client: grpc-java (application clients)
We need feature parity in both implementations for this to work. We're willing to implement both and contribute the code if the design is accepted. If we gain support on this issue, we can work on a gRFC as this would likely benefit from formal design review.
- 主要言語
- Java
- スター
- 12.1k
- フォーク
- 4k
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 30
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
grpc/grpc-java のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
grpc/grpc-java#13063 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
grpc/grpc-java#13052 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
grpc/grpc-java#10824 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
link-check link-check:manual
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
open-telemetry/opentelemetry-java#8870 ·
メンテナーはふだん 1 日以内に返信
-
P2 testing
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/core kind/bug status/triage team/core-shared
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信