Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/internal/notifier/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,11 @@ func (nc *Coordinator) sendEvaluatorRequests() {
timeNow := time.Now()
sendBefore := timeNow.Add(-time.Duration(nc.minInterval) * time.Second)

// Fire off evaluation requests for every group we know about
// Fire off evaluation requests for every group we know about. This loop writes groupInfo.LastEval,
// so it needs the write lock on the cluster - a read lock is not enough
nc.clusterLock.RLock()
for cluster, consumerGroup := range nc.clusters {
consumerGroup.Lock.RLock()
consumerGroup.Lock.Lock()
for consumer, groupInfo := range consumerGroup.Groups {
if groupInfo.LastEval.Before(sendBefore) {
nc.Log.Debug("Evaluating group", zap.String("group", consumer))
Expand All @@ -381,7 +382,7 @@ func (nc *Coordinator) sendEvaluatorRequests() {
groupInfo.LastEval = timeNow
}
}
consumerGroup.Lock.RUnlock()
consumerGroup.Lock.Unlock()
}
nc.clusterLock.RUnlock()

Expand Down