Skip to content

Commit e350840

Browse files
jin82jerrick-zhu
authored andcommitted
fix methodName and retries in FailoverClusterInvoker (#2145)
1 parent 3c5fe8b commit e350840

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailoverClusterInvoker.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.dubbo.rpc.RpcException;
2929
import org.apache.dubbo.rpc.cluster.Directory;
3030
import org.apache.dubbo.rpc.cluster.LoadBalance;
31+
import org.apache.dubbo.rpc.support.RpcUtils;
3132

3233
import java.util.ArrayList;
3334
import java.util.HashSet;
@@ -54,7 +55,8 @@ public FailoverClusterInvoker(Directory<T> directory) {
5455
public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
5556
List<Invoker<T>> copyinvokers = invokers;
5657
checkInvokers(copyinvokers, invocation);
57-
int len = getUrl().getMethodParameter(invocation.getMethodName(), Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
58+
String methodName = RpcUtils.getMethodName(invocation);
59+
int len = getUrl().getMethodParameter(methodName, Constants.RETRIES_KEY, Constants.DEFAULT_RETRIES) + 1;
5860
if (len <= 0) {
5961
len = 1;
6062
}
@@ -77,7 +79,7 @@ public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, L
7779
try {
7880
Result result = invoker.invoke(invocation);
7981
if (le != null && logger.isWarnEnabled()) {
80-
logger.warn("Although retry the method " + invocation.getMethodName()
82+
logger.warn("Although retry the method " + methodName
8183
+ " in the service " + getInterface().getName()
8284
+ " was successful by the provider " + invoker.getUrl().getAddress()
8385
+ ", but there have been failed providers " + providers
@@ -100,7 +102,7 @@ public Result doInvoke(Invocation invocation, final List<Invoker<T>> invokers, L
100102
}
101103
}
102104
throw new RpcException(le != null ? le.getCode() : 0, "Failed to invoke the method "
103-
+ invocation.getMethodName() + " in the service " + getInterface().getName()
105+
+ methodName + " in the service " + getInterface().getName()
104106
+ ". Tried " + len + " times of the providers " + providers
105107
+ " (" + providers.size() + "/" + copyinvokers.size()
106108
+ ") from the registry " + directory.getUrl().getAddress()

0 commit comments

Comments
 (0)