grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

latency between onMessage and onReady execution resulting in client timeout

Open chkrishna411 opened this issue 1 year ago • 2 comments

grpc server version used: 1.58.0 we are using spring boot starter net.devh with 2.15

We have seen timeouts from the client that the RPC was not processed within 70ms deadline.

To check the actual issue, we have increased the timeout and tested again. After implementing all the callbacks, we have observed a latency of close to 75ms between onReady() and onMessage().

Client and Server are running in the same subnet, and we are using Istio for routing the traffic b/w client and server. At the time of receiving the RPC, there was not much load as well to figure out whether it's because of thread unavailability of workers. Please check the attached image for logs.

report-grpc-timeout

This timeout issue is intermittent, it's not occurring every time. If we retry the request we are able to successfully process the rpc within 4-5ms.

chkrishna411 avatar Aug 22 '24 11:08 chkrishna411

The ServerCall.Listener onReady() callback only indicates that the response stream is now ready to receive messages from the server. It does not tell anything about the ability to receive incoming messages. You should instead log timestamps on the sender side such as from ClientCall.sendMessage and compare it with the timestamp logged in ServerCall.Listener::on message.

kannanjgithub avatar Aug 23 '24 14:08 kannanjgithub

What is your C++ gRPC version? What does the API call look like on the client - is it async, blocking or callbacks? I think the issue you are facing may be on the gRPC C++ side.

kannanjgithub avatar Oct 03 '24 05:10 kannanjgithub

A friendly reminder.

kannanjgithub avatar Nov 20 '24 08:11 kannanjgithub

Please feel free to comment to reopen the issue in the future if there is a need.

kannanjgithub avatar Nov 21 '24 07:11 kannanjgithub