From 1714b9f28694d750d446917672dd59c46e16afd7 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Wed, 6 Dec 2017 01:35:43 +0100 Subject: [PATCH] BUG/MEDIUM: email-alert: don't set server check status from a email-alert task This avoids possible 100% cpu usage deadlock on a EMAIL_ALERTS_LOCK and avoids sending lots of emails when 'option log-health-checks' is used. It is avoided to change the server state and possibly queue a new email while processing the email alert by setting check->status to HCHK_STATUS_UNKNOWN which will exit the set_server_check_status(..) early. This needs to be backported to 1.8. --- src/checks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checks.c b/src/checks.c index eaf84a225..3a6f02038 100644 --- a/src/checks.c +++ b/src/checks.c @@ -3145,7 +3145,7 @@ static struct task *process_email_alert(struct task *t) t->expire = now_ms; check->server = alert->srv; check->tcpcheck_rules = &alert->tcpcheck_rules; - check->status = HCHK_STATUS_INI; + check->status = HCHK_STATUS_UNKNOWN; // the UNKNOWN status is used to exit set_server_check_status(.) early check->state |= CHK_ST_ENABLED; }