修复重新加载RPC连接时可能死锁的问题

This commit is contained in:
刘祥超
2021-02-24 10:44:53 +08:00
parent 58a0521605
commit 8a8f9d2912

View File

@@ -375,9 +375,9 @@ func (this *RPCClient) init() error {
if len(conns) == 0 {
return errors.New("[RPC]no available endpoints")
}
this.locker.Lock()
// 这里不需要加锁因为会和pickConn冲突
this.conns = conns
this.locker.Unlock()
return nil
}