I had a weird bug on my code and I am not sure if it is because of my understanding of how Round Robin works in GRPC.
I have a manager channel builder like this where I pass in a hostname which is a DNS-RR Docker service.
final ManagedChannelBuilder<?> builder =
ManagedChannelBuilder.forAddress(hostname, 6565)
.defaultLoadBalancingPolicy("round_robin")
.usePlaintext()
.intercept(
new ClientInterceptor() {
@Override
public <R, Q> ClientCall<R, Q> interceptCall(
MethodDescriptor<R, Q> method, CallOptions callOptions, Channel next) {
log.info("{}", method.getFullMethodName());
return next.newCall(method, callOptions);
}
},
grpcTracing.newClientInterceptor())
.enableRetry()
.maxRetryAttempts(5);
I don't have the logs when it occured yet but it seemed that it seemed to keep on calling every node.
I don't want to choose pick_first because that means everything will go to one node, I was expecting round_robin to choose between available ones for each request.