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

master: fix panic when etcd member not started (#967) #970

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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