Skip to content
Snippets Groups Projects
Unverified Commit 4618a47e authored by Joe Zou's avatar Joe Zou Committed by GitHub
Browse files

Merge pull request #828 from watermelo/fix_etcd_reconnet

Fix: etcd cluster reconnect
parents 5f3d14d6 aebb0e85
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ LOOP:
r.ClientLock().Lock()
clientName := RegistryETCDV3Client
timeout, _ := time.ParseDuration(r.GetUrl().GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT))
endpoint := r.GetUrl().Location
endpoints := r.Client().endpoints
r.Client().Close()
r.SetClient(nil)
r.ClientLock().Unlock()
......@@ -80,11 +80,11 @@ LOOP:
err = ValidateClient(
r,
WithName(clientName),
WithEndpoints(endpoint),
WithEndpoints(endpoints...),
WithTimeout(timeout),
)
logger.Infof("ETCDV3ProviderRegistry.validateETCDV3Client(etcd Addr{%s}) = error{%#v}",
endpoint, perrors.WithStack(err))
endpoints, perrors.WithStack(err))
if err == nil && r.RestartCallBack() {
break
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment