Alanxtl commented on code in PR #3834:
URL: https://github.com/apache/dubbo-go/pull/3834#discussion_r4608437740
##########
protocol/triple/triple_protocol/client.go:
##########
@@ -322,7 +339,7 @@ func applyDefaultTimeout(ctx context.Context, timeout
time.Duration) (context.Co
timeoutVal := ctx.Value(TimeoutKey{})
if timeoutVal != nil {
if s, exist := timeoutVal.(string); exist && s != "" {
- if newTimeout, err := time.ParseDuration(s);
err == nil {
+ if newTimeout, parsed := parseTimeout(s);
parsed {
Review Comment:
```suggestion
if newTimeout, ok := parseTimeout(s); ok {
```
##########
protocol/triple/triple_invoker.go:
##########
@@ -237,9 +237,16 @@ func parseInvocation(ctx context.Context, url *common.URL,
invocation base.Invoc
}
// parseAttachments injects pre-defined URL attachments into invocation.
+// A call-level timeout already present on the invocation is not overwritten
+// by method/service URL configuration.
func parseAttachments(ctx context.Context, url *common.URL, invocation
base.Invocation) {
for _, key := range triAttachmentKeys {
if val := url.GetParam(key, ""); len(val) > 0 {
+ if key == constant.TimeoutKey {
+ if _, exists := invocation.GetAttachment(key);
exists {
+ continue
+ }
+ }
Review Comment:
这个修改是为了啥
--
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]