From: Christopher Faulet Date: Fri, 7 May 2021 09:45:26 +0000 (+0200) Subject: BUG/MINOR: checks: Reschedule check on observe mode only if fastinter is set X-Git-Tag: v2.4-dev19~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea860837183c4800c97d6e8e7fb417d8f1ab2ef0;p=thirdparty%2Fhaproxy.git BUG/MINOR: checks: Reschedule check on observe mode only if fastinter is set On observe mode, if a server is marked as DOWN, the server's health-check is rescheduled using the fastinter timeout if the new expiration date is newer that the current one. But this must only be performed if the fastinter timeout is defined. Internally, tick_is_lt() function only checks the date and does not perform any verification on the provided args. Thus, we must take care of it. However, it is possible to disable the server health-check by setting its task expiration date to TICK_ETERNITY. This patch must be backported as far as 2.2. It is related to --- diff --git a/src/check.c b/src/check.c index 1ad587cd1d..3403962607 100644 --- a/src/check.c +++ b/src/check.c @@ -716,7 +716,7 @@ void __health_adjust(struct server *s, short status) s->consecutive_errors = 0; _HA_ATOMIC_INC(&s->counters.failed_hana); - if (tick_is_lt(expire, s->check.task->expire)) { + if (tick_isset(expire) && tick_is_lt(expire, s->check.task->expire)) { /* requeue check task with new expire */ task_schedule(s->check.task, expire); }