What are the connectivity states of a gRPC channel and how does the channel manage them?
Last updated
Five states:
IDLE(no connection),CONNECTING,READY(RPCs flow),TRANSIENT_FAILURE(waiting with exponential backoff), and terminalSHUTDOWN.Transitions are automatic: an RPC on an idle channel triggers connecting, and failures back off before reconnecting. Apps can observe via
GetState()andWaitForStateChange().With
wait_for_ready, RPCs queue during non-ready states instead of failing fast.
- https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md
- https://www.skillveris.com/interview-questions/grpc/how-do-you-use-grpc-channel-connectivity-state-and-wait-for-ready
- https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html
- https://grpc.github.io/grpc-java/javadoc/io/grpc/ConnectivityState.html
- https://grpc.github.io/grpc/python/grpc.html
- https://grpc.io/docs/guides/wait-for-ready/
- https://grpc.github.io/grpc/core/md_doc_wait-for-ready.html
- https://grpc.io/docs/what-is-grpc/core-concepts/