Skip to content

Commit

Permalink
fix panic when getting the member which is not started
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Dec 13, 2023
1 parent f71de23 commit e688616
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/mcs/scheduling/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ func (s *Server) updateAPIServerMemberLoop() {
continue
}
for _, ep := range members.Members {
if len(ep.GetClientURLs()) == 0 { // This member is not started yet.
log.Info("member is not started yet", zap.String("member-id", fmt.Sprintf("%x", ep.GetID())), errs.ZapError(err))
continue
}
status, err := s.GetClient().Status(ctx, ep.ClientURLs[0])
if err != nil {
log.Info("failed to get status of member", zap.String("member-id", fmt.Sprintf("%x", ep.ID)), zap.String("endpoint", ep.ClientURLs[0]), errs.ZapError(err))
Expand Down

0 comments on commit e688616

Please sign in to comment.