This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 9f1a9f202 fix: leastactive choose wrong invoker (#2068)
9f1a9f202 is described below

commit 9f1a9f2023fc49aa7b731a9a6731b2da3169a95d
Author: 氕氘氚 <[email protected]>
AuthorDate: Thu Oct 6 20:13:44 2022 +0800

    fix: leastactive choose wrong invoker (#2068)
---
 cluster/loadbalance/leastactive/loadbalance.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cluster/loadbalance/leastactive/loadbalance.go 
b/cluster/loadbalance/leastactive/loadbalance.go
index dc52011be..5cc8ab62c 100644
--- a/cluster/loadbalance/leastactive/loadbalance.go
+++ b/cluster/loadbalance/leastactive/loadbalance.go
@@ -94,7 +94,7 @@ func (lb *leastActiveLoadBalance) Select(invokers 
[]protocol.Invoker, invocation
        }
 
        if leastCount == 1 {
-               return invokers[0]
+               return invokers[leastIndexes[0]]
        }
 
        if !sameWeight && totalWeight > 0 {

Reply via email to