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

This commit is contained in:
GoEdgeLab
2021-02-24 10:44:53 +08:00
parent 16d661a236
commit e86ad0f4da

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
}