From f3b7c2282748d2b3c5a6ee268e6bc949d51f7369 Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Wed, 22 Aug 2018 01:00:08 +0530 Subject: [PATCH] rules: add comment about lock taking (#4525) Signed-off-by: Goutham Veeramachaneni --- rules/alerting.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules/alerting.go b/rules/alerting.go index fe61583c3..d5c533d17 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -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