Merge pull request #2016 from mattbostock/fix_race_between_reload_and_stop

rules/manager.go: Fix race between reload and stop
This commit is contained in:
Fabian Reinartz 2016-09-22 19:30:56 +02:00 committed by GitHub
commit 5e57fa85c0
1 changed files with 3 additions and 0 deletions

View File

@ -365,6 +365,9 @@ func (m *Manager) Run() {
// Stop the rule manager's rule evaluation cycles. // Stop the rule manager's rule evaluation cycles.
func (m *Manager) Stop() { func (m *Manager) Stop() {
m.mtx.Lock()
defer m.mtx.Unlock()
log.Info("Stopping rule manager...") log.Info("Stopping rule manager...")
for _, eg := range m.groups { for _, eg := range m.groups {