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 2021/07/02 12:49:16 UTC

[GitHub] [dubbo-go] LaurenceLiZhixin commented on a change in pull request #1297: fix:#1143 Feature/reduce etcd registry conn

LaurenceLiZhixin commented on a change in pull request #1297:
URL: https://github.com/apache/dubbo-go/pull/1297#discussion_r662987965



##########
File path: remoting/etcdv3/facade.go
##########
@@ -46,54 +43,16 @@ type clientFacade interface {
 
 // HandleClientRestart keeps the connection between client and server
 func HandleClientRestart(r clientFacade) {
-	var (
-		err       error
-		failTimes int
-	)
-
 	defer r.WaitGroup().Done()
-LOOP:
 	for {
 		select {
+		case <-r.Client().GetCtx().Done():
+			r.RestartCallBack()
+			// re-register all services
+			time.Sleep(10 * time.Microsecond)

Review comment:
       为什么这里要Sleep?
   我看RestartCallBack的逻辑是重新注册,下面的逻辑是重建client,并且有重试逻辑。使用RestartCallBack的目的是什么呢?




-- 
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: notifications-unsubscribe@dubbo.apache.org

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