[ 
https://issues.apache.org/jira/browse/SCB-620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16496191#comment-16496191
 ] 

ASF GitHub Bot commented on SCB-620:
------------------------------------

asifdxtreme closed pull request #362: SCB-620 Switch to new client gracefully
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/362
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/plugin/infra/registry/etcd/etcd.go 
b/server/plugin/infra/registry/etcd/etcd.go
index 9243edbd..ffe1367a 100644
--- a/server/plugin/infra/registry/etcd/etcd.go
+++ b/server/plugin/infra/registry/etcd/etcd.go
@@ -600,13 +600,14 @@ hcLoop:
                                util.Logger().Errorf(cerr, "re-get etcd client 
%v failed.", c.Endpoints)
                                continue
                        }
-                       cerr = c.Client.Close()
-                       if cerr != nil {
-                               util.Logger().Errorf(cerr, "close unavailable 
etcd client failed.")
-                       }
-                       c.Client = client
 
+                       c.Client, client = client, c.Client
                        util.Logger().Errorf(err, "Auto sync etcd members 
failed and re-connected etcd successfully")
+
+                       if cerr = client.Close(); cerr != nil {
+                               util.Logger().Errorf(cerr, "close unavailable 
etcd client failed.")
+                       }
+                       client = nil
                }
        }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Add registry server HC machanism
> --------------------------------
>
>                 Key: SCB-620
>                 URL: https://issues.apache.org/jira/browse/SCB-620
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Service-Center
>            Reporter: little-cui
>            Assignee: little-cui
>            Priority: Major
>             Fix For: service-center-1.0.0-m2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to