nanjiek commented on code in PR #3231:
URL: https://github.com/apache/dubbo-go/pull/3231#discussion_r2899839070


##########
protocol/grpc/client.go:
##########
@@ -142,25 +118,25 @@ func NewClient(url *common.URL) (*Client, error) {
        }
 
        key := url.GetParam(constant.InterfaceKey, "")
-       //TODO: Temporary compatibility with old APIs, can be removed later
-       consumerService := config.GetConsumerServiceByInterfaceName(key)
-       if consumerService == nil {
-               if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); 
ok {
-                       consumerService = rpcService
-               }
+       var consumerService any
+       if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+               consumerService = rpcService
        }
        invoker := getInvoker(consumerService, conn)
+       invokerValue := reflect.Value{}
+       if invoker != nil {
+               invokerValue = reflect.ValueOf(invoker)
+       } else {
+               logger.Warnf("grpc client invoker is nil, interface=%s", key)
+       }

Review Comment:
   logger只能记录,程序在初始化 invoker(RPC 调用执行器)时发现对象为 nil应该终止,返回 error,阻止 Client 被创建。



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to