You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/07/23 02:54:30 UTC
[dubbo] branch master updated: optimize ShortestResponseLoadBalance
active param (#8318)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 41e989b optimize ShortestResponseLoadBalance active param (#8318)
41e989b is described below
commit 41e989b853b151e01aae53e41b9504e31f5e8f4a
Author: lmj <10...@qq.com>
AuthorDate: Fri Jul 23 10:54:09 2021 +0800
optimize ShortestResponseLoadBalance active param (#8318)
---
.../dubbo/rpc/cluster/loadbalance/ShortestResponseLoadBalance.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ShortestResponseLoadBalance.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ShortestResponseLoadBalance.java
index 610b1b4..5836884 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ShortestResponseLoadBalance.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/ShortestResponseLoadBalance.java
@@ -61,7 +61,7 @@ public class ShortestResponseLoadBalance extends AbstractLoadBalance {
RpcStatus rpcStatus = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName());
// Calculate the estimated response time from the product of active connections and succeeded average elapsed time.
long succeededAverageElapsed = rpcStatus.getSucceededAverageElapsed();
- int active = rpcStatus.getActive();
+ int active = rpcStatus.getActive() + 1;
long estimateResponse = succeededAverageElapsed * active;
int afterWarmup = getWeight(invoker, invocation);
weights[i] = afterWarmup;