AlexStocks commented on code in PR #2945:
URL: https://github.com/apache/dubbo-go/pull/2945#discussion_r2199272320
##########
protocol/triple/triple.go:
##########
@@ -85,10 +85,17 @@ func (tp *TripleProtocol) openServer(invoker base.Invoker,
info *common.ServiceI
panic("[TRIPLE Protocol]" + url.Key() + "is not existing")
}
- // TODO: handle errors
- tripleConfRaw, _ := url.GetAttribute(constant.TripleConfigKey)
- // TODO: verificate the tripleConf
- tripleConf, _ := tripleConfRaw.(*global.TripleConfig)
+ tripleConfRaw, ok := url.GetAttribute(constant.TripleConfigKey)
+ if !ok {
+ // NOTE: sometimes happened on old triple
+ logger.Debugf("Triple config is not found for url: %s",
url.Key())
Review Comment:
不应该是一个 warn log 吗?
##########
protocol/triple/triple.go:
##########
@@ -85,10 +85,17 @@ func (tp *TripleProtocol) openServer(invoker base.Invoker,
info *common.ServiceI
panic("[TRIPLE Protocol]" + url.Key() + "is not existing")
}
- // TODO: handle errors
- tripleConfRaw, _ := url.GetAttribute(constant.TripleConfigKey)
- // TODO: verificate the tripleConf
- tripleConf, _ := tripleConfRaw.(*global.TripleConfig)
+ tripleConfRaw, ok := url.GetAttribute(constant.TripleConfigKey)
+ if !ok {
+ // NOTE: sometimes happened on old triple
+ logger.Debugf("Triple config is not found for url: %s",
url.Key())
+ }
+
+ tripleConf, ok := tripleConfRaw.(*global.TripleConfig)
+ if !ok || tripleConf == nil {
+ // NOTE: sometimes happened on old triple
+ logger.Debugf("Triple config obtained from url: %s is not of
type *global.TripleConfig or is nil", url.Key())
Review Comment:
不应该是一个 warn log 吗?
--
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]