From a46198e5b1a18d9a7902e0ccbd3bfc65ee50f6a7 Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Fri, 21 Jul 2017 01:31:24 +0000 Subject: [PATCH] fix client discover pserver context cancelled It's already fixed by Wuyi's PR, but his PR may take some time to merge, but I want to get this change in ASAP. --- go/pserver/client/etcd_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/pserver/client/etcd_client.go b/go/pserver/client/etcd_client.go index 7ba56f7082..b6ff1fec8a 100644 --- a/go/pserver/client/etcd_client.go +++ b/go/pserver/client/etcd_client.go @@ -80,10 +80,10 @@ func (p *EtcdClient) List() []Server { for { for i := 0; i < psDesired; i++ { ctx, cancel := context.WithTimeout(context.Background(), p.timeout) - cancel() psKey := pserver.PsPath + strconv.Itoa(i) log.Debugf("checking %s", psKey) resp, err := p.client.Get(ctx, psKey) + cancel() if err != nil { log.Infof("Get psKey= %s error, %v", psKey, err) time.Sleep(p.timeout) -- GitLab