You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/07/29 13:29:25 UTC

[dubbo-go] branch 3.0 updated: fix Fixed the problem that the timeout period of the original method level does not take effect (#1336)

This is an automated email from the ASF dual-hosted git repository.

laurence pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new ebce04e  fix Fixed the problem that the timeout period of the original method level does not take effect (#1336)
ebce04e is described below

commit ebce04ec5dd18b6952346d54da0ab983e129bf7d
Author: XX <45...@users.noreply.github.com>
AuthorDate: Thu Jul 29 21:29:21 2021 +0800

    fix Fixed the problem that the timeout period of the original method level does not take effect (#1336)
    
    * fix Fixed the problem that the timeout period of the original method level does not take effect
    
    * fix Fixed the problem that the timeout period of the original method level does not take effect
    
    Co-authored-by: 董振兴 <do...@xiaomi.com>
---
 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 b755592..02cb220 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 := 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 {
 		if t, err := time.ParseDuration(timeout); err == nil {
 			// config timeout into attachment