Snow-kal commented on code in PR #3231:
URL: https://github.com/apache/dubbo-go/pull/3231#discussion_r2901412390
##########
protocol/dubbo3/dubbo3_protocol.go:
##########
@@ -80,17 +77,16 @@ func NewDubboProtocol() *DubboProtocol {
func (dp *DubboProtocol) Export(invoker base.Invoker) base.Exporter {
url := invoker.GetURL()
serviceKey := url.ServiceKey()
- exporter := NewDubboExporter(serviceKey, invoker, dp.ExporterMap(),
dp.serviceMap)
- dp.SetExporterMap(serviceKey, exporter)
- logger.Infof("[Triple Protocol] Export service: %s", url.String())
key := url.GetParam(constant.BeanNameKey, "")
var service any
- //TODO: Temporary compatibility with old APIs, can be removed later
- service = config.GetProviderService(key)
if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
service = rpcService
}
+ if service == nil {
+ logger.Errorf("no rpc service found in url attribute %s for
service key: %s", constant.RpcServiceKey, key)
+ return nil
Review Comment:
感谢建议 已更改
<img width="1595" height="197" alt="image"
src="https://github.com/user-attachments/assets/ca3bc952-e490-4645-b0ef-f07246991acd"
/>
现将 service == nil 时的处理从 logger.Errorf + return nil 改为 panic 直接暴露出原因
--
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]