Skip to content

Commit 841be4c

Browse files
committed
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.
1 parent 808a7cc commit 841be4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mailers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static struct task *process_email_alert(struct task *t, void *context, unsigned
8080

8181
alert = LIST_NEXT(&q->email_alerts, typeof(alert), list);
8282
LIST_DELETE(&alert->list);
83-
t->expire = now_ms;
83+
t->expire = tick_add(now_ms, 0);
8484
check->tcpcheck_rules = &alert->rules;
8585
check->status = HCHK_STATUS_INI;
8686
check->state |= CHK_ST_ENABLED;

0 commit comments

Comments
 (0)