mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
1.优化CALL Rpc错误返回
2.优化不同邻居Master服务发现规则
This commit is contained in:
@@ -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!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user