rules: add comment about lock taking (#4525)

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
This commit is contained in:
Goutham Veeramachaneni 2018-08-22 01:00:08 +05:30 committed by Julius Volz
parent c663477688
commit f3b7c22827
1 changed files with 2 additions and 0 deletions

View File

@ -365,6 +365,8 @@ func (r *AlertingRule) Eval(ctx context.Context, ts time.Time, query QueryFunc,
}
}
// We have already acquired the lock above hence using SetHealth and
// SetLastError will deadlock.
r.health = HealthGood
r.lastError = err
return vec, nil