Skip to content

Commit

Permalink
vendor: update pd-client (pingcap#2231)
Browse files Browse the repository at this point in the history
  • Loading branch information
huachaohuang authored and zimulala committed Dec 13, 2016
1 parent c30849a commit 2c7ca81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions _vendor/src/github.com/pingcap/pd/pd-client/rpc_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,21 @@ func newMsgID() uint64 {
}

func (w *rpcWorker) initClusterID() error {
conn := mustNewConn(w.urls, w.quit)
if conn == nil {
return errors.New("client closed")
}
defer conn.Close()

for i := 0; i < maxInitClusterRetries; i++ {
conn := mustNewConn(w.urls, w.quit)
if conn == nil {
return errors.New("client closed")
}

clusterID, err := w.getClusterID(conn.ReadWriter)
// We need to close this connection no matter success or not.
conn.Close()

if err == nil {
w.clusterID = clusterID
return nil
}

log.Errorf("[pd] failed to get cluster id: %v", err)
time.Sleep(time.Second)
}
Expand Down
6 changes: 3 additions & 3 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import:
subpackages:
- lex
- package: github.com/pingcap/pd
version: e3fdded938ceabe4f6297442e8d179f1d40a9ff4
version: 3d5bb2b3a056925b656d29b88a5b216f6f309368
- package: github.com/pingcap/tipb
version: 7be8865936fd4dfee0591913c31c07be11da5d19
subpackages:
Expand Down

0 comments on commit 2c7ca81

Please sign in to comment.