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



##########
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:
       代码实现参照zk对于连接过多的优化,做了类似的实现。
   <-GetCtx().Done()意味着已经断连,需要调用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-unsubscr...@dubbo.apache.org

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



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

Reply via email to