diff --git a/cluster/loadbalance/least_active_test.go b/cluster/loadbalance/least_active_test.go index 8f2d5402fade1cf7d808e60d78d99797908b34be..c29a2092a19161d0dd75ee4098ee786b620880b0 100644 --- a/cluster/loadbalance/least_active_test.go +++ b/cluster/loadbalance/least_active_test.go @@ -45,8 +45,6 @@ func TestLeastActiveByWeight(t *testing.T) { inv := new(invocation.RPCInvocation) inv.SetMethod("test") - - // test3 active count equals 1 protocol.BeginCount(invokers[2].GetUrl(), inv.MethodName()) loop = 10000 @@ -66,5 +64,4 @@ func TestLeastActiveByWeight(t *testing.T) { } assert.Equal(t, firstCount+secondCount, loop) - } diff --git a/protocol/RpcStatus.go b/protocol/RpcStatus.go index fb0f789991cf0aa69a19e2c327c340b0686b6e4d..b9f3e6ecb18583034e310471164773bebe689cd9 100644 --- a/protocol/RpcStatus.go +++ b/protocol/RpcStatus.go @@ -38,11 +38,11 @@ func GetStatus(url common.URL, methodName string) *RpcStatus { identifier := url.Key() methodMap, found := methodStatistics.Load(identifier) if !found { - methodMap = sync.Map{} + methodMap = &sync.Map{} methodStatistics.Store(identifier, methodMap) } - methodActive := methodMap.(sync.Map) + methodActive := methodMap.(*sync.Map) rpcStatus, found := methodActive.Load(methodName) if !found { rpcStatus = &RpcStatus{}