1.优化CALL Rpc错误返回

2.优化不同邻居Master服务发现规则
This commit is contained in:
boyce
2021-05-07 17:47:49 +08:00
parent 212798dc04
commit 806e4040db
3 changed files with 40 additions and 12 deletions

View File

@@ -396,11 +396,14 @@ func (handler *RpcHandler) goRpc(processor IRpcProcessor,bCast bool,nodeId int,s
func (handler *RpcHandler) callRpc(nodeId int,serviceMethod string,args interface{},reply interface{}) error {
var pClientList [maxClusterNode]*Client
err,count := handler.funcRpcClient(nodeId,serviceMethod,pClientList[:])
if count==0||err != nil {
if err != nil {
log.Error("Call serviceMethod is error:%+v!",err)
return err
}
if count > 1 {
}else if count <=0 {
err = fmt.Errorf("Call serviceMethod is error:cannot find %s",serviceMethod)
log.Error("%s",err.Error())
return err
}else if count > 1 {
log.Error("Cannot call more then 1 node!")
return fmt.Errorf("Cannot call more then 1 node!")
}