You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/11/29 13:17:25 UTC

[GitHub] [dubbo-go] flycash commented on a change in pull request #1604: [WIP]fix tps filter panic bug(pre-check the configuration of tps at the st…

flycash commented on a change in pull request #1604:
URL: https://github.com/apache/dubbo-go/pull/1604#discussion_r758349587



##########
File path: config/method_config.go
##########
@@ -70,9 +76,34 @@ func initProviderMethodConfig(sc *ServiceConfig) error {
 }
 
 // check set default value and verify
-func (mc *MethodConfig) check() error {
-	if err := defaults.Set(mc); err != nil {
+func (m *MethodConfig) check() error {
+	qualifieldMethodName := m.InterfaceName + "#" + m.Name
+	if m.TpsLimitStrategy != "" {
+		_ = extension.GetTpsLimitStrategyCreator(m.TpsLimitStrategy)

Review comment:
       why we call this? you don't use the return value.

##########
File path: config/method_config.go
##########
@@ -70,9 +76,34 @@ func initProviderMethodConfig(sc *ServiceConfig) error {
 }
 
 // check set default value and verify
-func (mc *MethodConfig) check() error {
-	if err := defaults.Set(mc); err != nil {
+func (m *MethodConfig) check() error {
+	qualifieldMethodName := m.InterfaceName + "#" + m.Name
+	if m.TpsLimitStrategy != "" {
+		_ = extension.GetTpsLimitStrategyCreator(m.TpsLimitStrategy)

Review comment:
       I prefer that you add one more function to check if the creator exist. And then you log error here.




-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org