Alanxtl commented on code in PR #3180:
URL: https://github.com/apache/dubbo-go/pull/3180#discussion_r2724936870
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -191,25 +196,36 @@ func (t *retryTimerTask) checkRetry() {
t.invocation.MethodName(), t.clusterInvoker.GetURL().Service(),
t.lastErr)
t.retries++
t.lastT = time.Now()
- if t.retries > t.maxRetries {
+ t.nextBackoff = t.backoff.NextBackOff() // calculate next exponential
backoff wait time
+
+ if t.retries > t.maxRetries || t.nextBackoff == backoff.Stop {
logger.Errorf("Retry times exceed threshold (%v), invocation->
%v.\n",
t.retries, t.invocation)
return
}
+ logger.Infof("Failback retry scheduled after %v for method %v",
t.nextBackoff, t.invocation.MethodName())
+
if err := t.clusterInvoker.taskList.Put(t); err != nil {
logger.Errorf("invoker.taskList.Put(retryTask:%#v) = error:%v",
t, err)
}
}
Review Comment:
是不是应该在put(t)成功之后再更新`t.lastT = time.Now()`,即把198行放到211行之后
##########
cluster/cluster/failback/cluster_invoker.go:
##########
@@ -191,25 +196,36 @@ func (t *retryTimerTask) checkRetry() {
t.invocation.MethodName(), t.clusterInvoker.GetURL().Service(),
t.lastErr)
t.retries++
t.lastT = time.Now()
- if t.retries > t.maxRetries {
+ t.nextBackoff = t.backoff.NextBackOff() // calculate next exponential
backoff wait time
+
+ if t.retries > t.maxRetries || t.nextBackoff == backoff.Stop {
logger.Errorf("Retry times exceed threshold (%v), invocation->
%v.\n",
Review Comment:
```suggestion
logger.Errorf("Retry times exceed threshold (%v), invocation->
%v",
```
--
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]