Support stream-level rebalancing for long-running RPCs (MaxStreamAge)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- grpc, java
Línea de trabajo
Comienza con la propuesta A9 de gestión de conexiones en el lado del servidor y las referencias de grpc-go a keepalive.go e internal/transport/http2_server.go. Después, revisa el ciclo de vida de los streams y los puntos de entrada del manejo de errores de grpc-java, que no se mencionan en el issue. Se considera terminado cuando exista un diseño gRFC aceptado que cubra el jitter, el estado de terminación, el comportamiento de reintento y la paridad de funcionalidades para grpc-java y grpc-go.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 12.1k
- Forks
- 4k
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 30
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de grpc/grpc-java
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
grpc/grpc-java#13063 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
grpc/grpc-java#13052 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Support of `dns:name` URIsAbiertodocs enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
grpc/grpc-java#10824 · 8 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
Todos los issues de grpc/grpc-java
Issues similares
-
ScyllaDB Manual: 3 broken linksAbiertolink-check link-check:manual
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
open-telemetry/opentelemetry-java#8870 ·
Los mantenedores suelen responder en 1 día
-
P2 testing
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
enhancement javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area/core kind/bug status/triage team/core-shared
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día