Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
master: fix panic when etcd member not started (#970)
Browse files Browse the repository at this point in the history
Co-authored-by: lance6716 <[email protected]>
  • Loading branch information
ti-srebot and lance6716 authored Sep 1, 2020
1 parent d31ab59 commit 714ac6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dm/master/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1867,9 +1867,13 @@ func (s *Server) listMemberMaster(ctx context.Context, names []string) (*pb.Memb
}

alive := true
_, err := client.Get(etcdMember.ClientURLs[0] + "/health")
if err != nil {
if len(etcdMember.ClientURLs) == 0 {
alive = false
} else {
_, err := client.Get(etcdMember.ClientURLs[0] + "/health")
if err != nil {
alive = false
}
}

masters = append(masters, &pb.MasterInfo{
Expand Down

0 comments on commit 714ac6d

Please sign in to comment.