Search code examples
grpcgrpc-java

Error : too_many_pings error in gRPC service calls


What is too_many_pings error in grpc?

  1. Are these error only from server to client side or there are use cases where client can also send the same to server(I know its weird! but in case any use case exist!!)

  2. Does the server disconnects the channel after this error or still ready to receive request ?

How to avoid it? Is it a good idea to avoid it?

Thanks in advance, Nilotpal


Solution

  • See this https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#server-enforcement for more information.

    1. Yes, only from server to client. No use-case for client-to-server.

    2. Yes, as per https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#server-enforcement.

    I think it's a good idea to avoid clients sending too many pings. In Java you can use ManagedChannelBuilder.keepAliveTime().