mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix data races and improve testing (#81994)
* Alerting: fix race condition in (*ngalert/sender.ExternalAlertmanager).Run * Chore: Fix data races when accessing members of *ngalert/state.FakeInstanceStore * Chore: Fix data races in tests in ngalert/schedule and enable some parallel tests * Chore: fix linters * Chore: add TODO comment to remove loopvar once we move to Go 1.22
This commit is contained in:
committed by
GitHub
parent
06b5875c3c
commit
9c29e1a783
@@ -127,13 +127,14 @@ func (s *ExternalAlertmanager) ApplyConfig(orgId, id int64, alertmanagers []Exte
|
||||
}
|
||||
|
||||
func (s *ExternalAlertmanager) Run() {
|
||||
logger := s.logger
|
||||
s.wg.Add(2)
|
||||
|
||||
go func() {
|
||||
s.logger.Info("Initiating communication with a group of external Alertmanagers")
|
||||
logger.Info("Initiating communication with a group of external Alertmanagers")
|
||||
|
||||
if err := s.sdManager.Run(); err != nil {
|
||||
s.logger.Error("Failed to start the sender service discovery manager", "error", err)
|
||||
logger.Error("Failed to start the sender service discovery manager", "error", err)
|
||||
}
|
||||
s.wg.Done()
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user