why dubbo provider retries configuration ineffective?

93 Views Asked by At

dubbo version:2.7.14 spring cloud && nacos 2.0.3 for registration center

enter image description here I set dubbo.provider.retries=0 in application.yml, and when it registers to nacos, seems that the configuration is effetive.

enter image description here But when the consumer invoke one of the methods, consumer still retried 3 times(defalut times). So why the configuration is ineffetive confuse me.

If you have some ideas, please tell me, thanks! Sorry for my poor English...

2

There are 2 best solutions below

0
shanfeng On

Check configuration of consumer.
https://dubbo.apache.org/zh/docs/v2.7/user/configuration/xml/
Configuration of consumer has a higher priority.

Overrides and Priorities
Take timeout as an example, here is the priorities, from high to low (retries, loadbalance, actives also applies the same rule):
method level,interface level,default/global level
at the same level, consumer has higher priority than provider

0
vio-lin On

it has differenc in retries config with timeout config.
so as known in FailoverClusterInvoker ,it will retry an other invoker when invoker is down.
but when there are two invokers with difference retries invoker shoule which effect.

as for dubbo 2.7 the retry come from url consumer

int len = getUrl().getMethodParameter(methodName, RETRIES_KEY, DEFAULT_RETRIES) + 1;

it will be referesh many times as invoker be create in
org.apache.dubbo.rpc.cluster.support.ClusterUtils.mergeUrl
and use final provider's config

and in 3.2 this getUrl() only changed when config in reference config.

in timeout every provider invoker can has own timeout.