Skip to content

Commit

Permalink
fix bug apache#2546,change timeout of DubboInvoker from Milliseconds …
Browse files Browse the repository at this point in the history
…to Nanoseconds
  • Loading branch information
Qi, Xiaoqiang committed Dec 30, 2023
1 parent 19d1da0 commit 7947c0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion protocol/dubbo/dubbo_invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (di *DubboInvoker) getTimeout(ivc *invocation.RPCInvocation) time.Duration
timeout, _ = time.ParseDuration(mTimeout)
}
// set timeout into invocation
ivc.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(timeout.Milliseconds())))
ivc.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(timeout.Nanoseconds())))
}
return timeout
}
Expand Down
4 changes: 2 additions & 2 deletions protocol/dubbo3/dubbo3_invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ func (di *DubboInvoker) getTimeout(invocation *invocation_impl.RPCInvocation) ti
if len(timeout) != 0 {
if t, err := time.ParseDuration(timeout); err == nil {
// config timeout into attachment
invocation.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(t.Milliseconds())))
invocation.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(t.Nanoseconds())))
return t
}
}
// set timeout into invocation at method level
invocation.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(di.timeout.Milliseconds())))
invocation.SetAttachment(constant.TimeoutKey, strconv.Itoa(int(di.timeout.Nanoseconds())))
return di.timeout
}

Expand Down

0 comments on commit 7947c0e

Please sign in to comment.