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?