Closed EndlessSeeker closed 1 month ago
https://github.com/apache/dubbo-go/blob/52c81032a6437c458b0d953596bd457a92b3d271/cluster/cluster/failover/cluster_invoker.go#L107-L120 默认走的是failover,可以看看这段代码,他实际上拿的是client上默认的retries,所以为重试2次
https://github.com/apache/dubbo-go/blob/52c81032a6437c458b0d953596bd457a92b3d271/cluster/cluster/failback/cluster_invoker.go#L215-L217 有意思的是,从源码可以看出WithCallRetries在failback策略是起作用的,反而WithClientRetries在failback不起作用
那么如果WithCallRetries的初衷是希望让本次调用走指定的次数,那么这里存在着bug 且如果WithCallRetries是默认让端上所有未定义的请求走指定次数,那这或许也存在bug,如果我理解没问题的话
那么如果WithCallRetries的初衷是希望让本次调用走指定的次数,那么这里存在着bug 且如果WithCallRetries是默认让端上所有未定义的请求走指定次数,那这或许也存在bug,如果我理解没问题的话
我觉得你的理解是正确的,这么做是合理的
resp, err := svc.Greet(context.Background(), &greet.GreetRequest{Name: "correct name"}, client.WithCallRetries(1)) if err != nil { logger.Errorf("call Greet failed, err: %s", err.Error()) }
is this issue resolved already?
resolved in #2717
Environment
Issue description
在尝试客户端调用服务端,服务端报错的case时,发现客户端会默认重试3次,但是我指定服务调用的重试次数为1时,仍然会进行3次调用,重试的配置没有生效
Logs
client log
server log