I have a grpc server in in javascript and client in java running android api level 25. I am trying to use bidi stream to communicate using between the client and the server using keepalive settings. When the android client initiate a request I send a metadata before any streaming calls. But after few seconds ( 5 to 10 ) it receives ‘System.err: io.grpc.StatusRuntimeException: UNAVAILABLE: Keepalive failed. The connection is likely gone’ even though the server is up and running.
Client side keepalive setting:
AndroidChannelBuilder.forAddress(Constants.BIDIRECTION_STREAM_DOMAIN,Constants.BIDIRECTION_STREAM_PORT)
.usePlaintext().keepAliveTime(10,TimeUnit.SECONDS).keepAliveTimeout(5,TimeUnit.SECONDS)
.keepAliveWithoutCalls(true).build();
Server side keepalive setting:
'grpc.keepalive_time_ms': 10_000,
'grpc.keepalive_timeout_ms': 5_000,
'grpc.keepalive_permit_without_calls': 1,
'grpc.http2.min_time_between_pings_ms': 5_000,
'grpc.http2.max_pings_without_data': 0,
'grpc.http2.max_ping_strikes': 1
Roshan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.