You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/06/27 13:41:59 UTC

[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #632: fix: enhancement cluster code analysis

AlexStocks commented on a change in pull request #632:
URL: https://github.com/apache/dubbo-go/pull/632#discussion_r446527918



##########
File path: cluster/cluster_impl/failback_cluster_invoker.go
##########
@@ -91,26 +91,25 @@ func (invoker *failbackClusterInvoker) process(ctx context.Context) {
 			}
 
 			// ignore return. the get must success.
-			_, err = invoker.taskList.Get(1)
-			if err != nil {
+			if _, err = invoker.taskList.Get(1); err != nil {
 				logger.Warnf("get task found err: %v\n", err)
 				break
 			}
+			go invoker.tryTimerTaskProc(ctx, retryTask)
+		}
+	}
+}
 
-			go func(retryTask *retryTimerTask) {
-				invoked := make([]protocol.Invoker, 0)
-				invoked = append(invoked, retryTask.lastInvoker)
-
-				retryInvoker := invoker.doSelect(retryTask.loadbalance, retryTask.invocation, retryTask.invokers, invoked)
-				var result protocol.Result
-				result = retryInvoker.Invoke(ctx, retryTask.invocation)
-				if result.Error() != nil {
-					retryTask.lastInvoker = retryInvoker
-					invoker.checkRetry(retryTask, result.Error())
-				}
-			}(retryTask)
+func (invoker *failbackClusterInvoker) tryTimerTaskProc(ctx context.Context, retryTask *retryTimerTask) {

Review comment:
       pls move this func up the process.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org