Skip to content

Commit

Permalink
cluster: fix concurrent map writes (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
srstack authored May 24, 2022
1 parent f7d350a commit fd85680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/manager/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ func (m *Manager) GetClusterTopology(name string, opt operator.Options) ([]InstI
}

status := ins.Status(ctx, statusTimeout, tlsCfg, masterList...)
mu.Lock()
if strings.HasPrefix(status, "Up") || strings.HasPrefix(status, "Healthy") {
instAddr := fmt.Sprintf("%s:%d", ins.GetHost(), ins.GetPort())
mu.Lock()
masterActive = append(masterActive, instAddr)
mu.Unlock()
}
masterStatus[ins.ID()] = status
mu.Unlock()
}, opt.Concurrency)

var dashboardAddr string
Expand Down

0 comments on commit fd85680

Please sign in to comment.