From 75fe0d61ffa16a25af2bb3a02366c2ce84b843ee Mon Sep 17 00:00:00 2001 From: charliesignalfx Date: Wed, 27 Mar 2019 12:12:29 -0700 Subject: [PATCH] consider removing members that are not started --- embetcd/memberInfo.go | 4 +++- embetcd/server.go | 16 +++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/embetcd/memberInfo.go b/embetcd/memberInfo.go index 8f5aa98..978aad3 100644 --- a/embetcd/memberInfo.go +++ b/embetcd/memberInfo.go @@ -84,7 +84,9 @@ func (m *Members) Get(member *membership.Member) (info *Member) { info.Member = member // update the member client endpoints - info.Client.SetEndpoints(member.ClientURLs...) + if member != nil && member.ClientURLs != nil { + info.Client.SetEndpoints(member.ClientURLs...) + } return info } diff --git a/embetcd/server.go b/embetcd/server.go index 95d6ea3..b063667 100644 --- a/embetcd/server.go +++ b/embetcd/server.go @@ -399,17 +399,15 @@ func (s *Server) cleanCluster(ctx context.Context, members *Members, client *Cli for _, cmember := range currentMembers { // wait to check health until the member is listed as started - if cmember.IsStarted() { - currentMemberIDs[uint64(cmember.ID)] = struct{}{} + currentMemberIDs[uint64(cmember.ID)] = struct{}{} - // fetch the health of the member in a separate go routine - wg.Add(1) - go func(m *Member) { - m.Update(client) - wg.Done() - }(members.Get(cmember)) - } + // fetch the health of the member in a separate go routine + wg.Add(1) + go func(m *Member) { + m.Update(client) + wg.Done() + }(members.Get(cmember)) }