nano icon indicating copy to clipboard operation
nano copied to clipboard

cluster模式,s.RPC通讯不能获取到另一个服务的错误

Open lwelcom opened this issue 4 years ago • 2 comments
trafficstars

Question

示例网关节点服务A: err := s.RPC("TopicService.NewUser", request) fmt.Println(err,"-------------------err") if err != nil { return errors.Trace(err) }

Master节点服务B: func (ts *TopicService) NewUser(s *session.Session, msg *protocol.NewUserRequest) error { fmt.Println("---------------NewUser err") return errors.Trace(errors.New("------------------123 err return"))

问题:服务B不管是关闭进程还是正常返回错误,服务A的s.RPC调用后err永远是nil

lwelcom avatar Aug 23 '21 04:08 lwelcom

image

a.rpcHandler(a.session, msg, true) 问题在于这个rpc是一个go异步回调函数,并没返回值

lwelcom avatar Aug 23 '21 07:08 lwelcom

@lwelcom Can you submit a pull request to fix it?

lonng avatar Aug 28 '21 13:08 lonng