4

The code model looks like as

 Iterator iterator = grpc.invokeSomeRequest(requestData) //returns iterator
 while(iterator.hasNext()){
     //do some code.
 }

Sometimes the error occurs at iterator.hasNext() with stack trace:

UNAVAILABLE: io exception               
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception                                                                                                                                
     at io.grpc.Status.asRuntimeException(Status.java:533) 

A version of grpc is 1.21.0

I figured out that this problem most likely at grpc. I could be wrong. What is the best workaround for this problem?

Stanislav Serdiuk
  • 421
  • 1
  • 6
  • 21
  • 1
    I'm curious why the error "sometimes" occurs at one place. Are there multiple errors? Does it fail in other places? Otherwise, this UNAVAILABLE error is likely to be a general network problem. Try checking basic connectivity (can you ping one machine from the other, are there firewall rules blocking connections, etc), then make sure your gRPC server is running before you try to connect (is the server listening on the right address, are the ports open, etc). – drfloob Jan 27 '21 at 20:40
  • StatusRuntimeException should have a cause with the actual I/O exception that caused the failure. – Eric Anderson Jan 28 '21 at 19:40
  • @EricAnderson io.grpc.StatusRuntimeException: UNAVAILABLE - This is all I have. The rest stack trace is related to the processing of my functions. – Stanislav Serdiuk Jan 29 '21 at 13:29
  • @drfloob Thank you. I think it is a network problem too and hope it is not an internal error. I can not replicate this problem but I must sure there are not any pitfalls. – Stanislav Serdiuk Jan 29 '21 at 13:36
  • @StanislavSerdiuk, yes, the stack trace of the StatusRuntimeException would be like that. But there should be a "caused by" and an additional exception listed. You can also see it by calling `getCause()` on the StatusRuntimeException. – Eric Anderson Feb 01 '21 at 18:39
  • 1
    Is there any solution for this? – PAA Nov 07 '21 at 15:10

0 Answers0