From 2da1bc38d2f959095adfd1295317d99cc7b41232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=8C=AF=E5=85=B4?= Date: Thu, 22 Jul 2021 11:23:16 +0800 Subject: [PATCH 1/2] fix Fixed the problem that the timeout period of the original method level does not take effect --- protocol/dubbo/dubbo_invoker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocol/dubbo/dubbo_invoker.go b/protocol/dubbo/dubbo_invoker.go index b755592d49..a1ba0c6c0e 100644 --- a/protocol/dubbo/dubbo_invoker.go +++ b/protocol/dubbo/dubbo_invoker.go @@ -168,7 +168,11 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati // get timeout including methodConfig func (di *DubboInvoker) getTimeout(invocation *invocation_impl.RPCInvocation) time.Duration { - timeout := di.GetURL().GetParam(strings.Join([]string{constant.METHOD_KEYS, invocation.MethodName(), constant.TIMEOUT_KEY}, "."), "") + methodName, ok := invocation.Arguments()[0].(string) + if !ok { + methodName = invocation.MethodName() + } + timeout := di.GetURL().GetParam(strings.Join([]string{constant.METHOD_KEYS, methodName, constant.TIMEOUT_KEY}, "."), "") if len(timeout) != 0 { if t, err := time.ParseDuration(timeout); err == nil { // config timeout into attachment From c2adbf7ad80fc4d1d3e251c6b8cc9091a1e654c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E6=8C=AF=E5=85=B4?= Date: Thu, 22 Jul 2021 21:15:17 +0800 Subject: [PATCH 2/2] fix Fixed the problem that the timeout period of the original method level does not take effect --- protocol/dubbo/dubbo_invoker.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/dubbo/dubbo_invoker.go b/protocol/dubbo/dubbo_invoker.go index a1ba0c6c0e..02cb2209a0 100644 --- a/protocol/dubbo/dubbo_invoker.go +++ b/protocol/dubbo/dubbo_invoker.go @@ -168,9 +168,9 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati // get timeout including methodConfig func (di *DubboInvoker) getTimeout(invocation *invocation_impl.RPCInvocation) time.Duration { - methodName, ok := invocation.Arguments()[0].(string) - if !ok { - methodName = invocation.MethodName() + methodName := invocation.MethodName() + if di.GetURL().GetParamBool(constant.GENERIC_KEY, false) { + methodName = invocation.Arguments()[0].(string) } timeout := di.GetURL().GetParam(strings.Join([]string{constant.METHOD_KEYS, methodName, constant.TIMEOUT_KEY}, "."), "") if len(timeout) != 0 {