From: Willy Tarreau Date: Fri, 15 Nov 2024 14:39:58 +0000 (+0100) Subject: BUG/MEDIUM: mailers: make sure to always apply offsets to now_ms in expiration X-Git-Tag: v3.0.7~38 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=4ebe6dcb318208857c3a3e9d4dca4c24f5b9c3cc;p=haproxy-3.0.git BUG/MEDIUM: mailers: make sure to always apply offsets to now_ms in expiration Now_ms can be zero nowadays, so it's not suitable for direct assignment to t->expire, as there's a risk that the timer never wakes up once assigned (TICK_ETERNITY). Let's use tick_add(now_ms, 0) for an immediate wakeup instead. The impact here might be mailers suddenly stopping. This should be backported where it applies. (cherry picked from commit 841be4cdd15b3d0834a478cc95ebda0f47171b4d) Signed-off-by: Christopher Faulet --- diff --git a/src/mailers.c b/src/mailers.c index c09e73c..58c8d88 100644 --- a/src/mailers.c +++ b/src/mailers.c @@ -80,7 +80,7 @@ static struct task *process_email_alert(struct task *t, void *context, unsigned alert = LIST_NEXT(&q->email_alerts, typeof(alert), list); LIST_DELETE(&alert->list); - t->expire = now_ms; + t->expire = tick_add(now_ms, 0); check->tcpcheck_rules = &alert->rules; check->status = HCHK_STATUS_INI; check->state |= CHK_ST_ENABLED;