修复rpc 客户端锁处理
This commit is contained in:
parent
10881f1411
commit
c8ed280049
@ -352,18 +352,18 @@ func (this *Service) call(ctx context.Context, clusterTag string, servicePath st
|
|||||||
err = fmt.Errorf("on found serviceTag:%s", clusterTag)
|
err = fmt.Errorf("on found serviceTag:%s", clusterTag)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.clientmutex.RLock()
|
|
||||||
if clientaddr = selector.Select(ctx, spath[0], serviceMethod, args); clientaddr == "" {
|
if clientaddr = selector.Select(ctx, spath[0], serviceMethod, args); clientaddr == "" {
|
||||||
err = fmt.Errorf("on found servicePath:%s", servicePath)
|
err = fmt.Errorf("on found servicePath:%s", servicePath)
|
||||||
this.clientmutex.RUnlock()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.clientmutex.RUnlock()
|
this.clientmutex.RLock()
|
||||||
if conn, ok = this.clients[clientaddr]; !ok {
|
if conn, ok = this.clients[clientaddr]; !ok {
|
||||||
err = fmt.Errorf("on found clientaddr:%s", clientaddr)
|
err = fmt.Errorf("on found clientaddr:%s", clientaddr)
|
||||||
|
this.clientmutex.RUnlock()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.clientmutex.RUnlock()
|
||||||
_call = new(client.Call)
|
_call = new(client.Call)
|
||||||
_call.ServicePath = servicePath
|
_call.ServicePath = servicePath
|
||||||
_call.ServiceMethod = serviceMethod
|
_call.ServiceMethod = serviceMethod
|
||||||
|
Loading…
Reference in New Issue
Block a user