Skip to content

Commit 9e71e23

Browse files
lixiaojieekhanimteyaz
authored andcommitted
optimize the RondRobinLoadBalance and MockClusterInvoker (apache#2932)
delete unused logic and take the logger out.
1 parent 7f5bccb commit 9e71e23

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation
108108
weightedRoundRobin = new WeightedRoundRobin();
109109
weightedRoundRobin.setWeight(weight);
110110
map.putIfAbsent(identifyString, weightedRoundRobin);
111-
weightedRoundRobin = map.get(identifyString);
112111
}
113112
if (weight != weightedRoundRobin.getWeight()) {
114113
//weight changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ public Result invoke(Invocation invocation) throws RpcException {
8686
} catch (RpcException e) {
8787
if (e.isBiz()) {
8888
throw e;
89-
} else {
90-
if (logger.isWarnEnabled()) {
91-
logger.warn("fail-mock: " + invocation.getMethodName() + " fail-mock enabled , url : " + directory.getUrl(), e);
92-
}
93-
result = doMockInvoke(invocation, e);
9489
}
90+
91+
if (logger.isWarnEnabled()) {
92+
logger.warn("fail-mock: " + invocation.getMethodName() + " fail-mock enabled , url : " + directory.getUrl(), e);
93+
}
94+
result = doMockInvoke(invocation, e);
9595
}
9696
}
9797
return result;

0 commit comments

Comments
 (0)