Skip to content

Commit

Permalink
consider removing members that are not started
Browse files Browse the repository at this point in the history
  • Loading branch information
charless-splunk committed Mar 27, 2019
1 parent ced26b9 commit 75fe0d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 3 additions & 1 deletion embetcd/memberInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
16 changes: 7 additions & 9 deletions embetcd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

}

Expand Down

0 comments on commit 75fe0d6

Please sign in to comment.