From: Christopher Faulet Date: Tue, 3 Jun 2025 12:50:38 +0000 (+0200) Subject: BUG/MEDIUM: check: Requeue healthchecks on I/O events to handle check timeout X-Git-Tag: v3.3-dev1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c788f0984623f727a71ae4aee9917ddeac1b59d;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: check: Requeue healthchecks on I/O events to handle check timeout When a healthchecks is processed, once the first wakeup passed to start the check, and as long as the expiration timer is not reached, only I/O events are able to wake it up. It is an issue when there is a check timeout defined. Especially if the connect timeout is high and the check timeout is low. In that case, the healthcheck's task is never requeue to handle any timeout update. When the connection is established, the check timeout is set to replace the connect timeout. It is thus possible to report a success while a timeout should be reported. So, now, when an I/O event is handled, the healthcheck is requeue, except if an success or an abort is reported. Thanks to Thierry Fournier for report and the reproducer. This patch must be backported to all stable versions. --- diff --git a/src/check.c b/src/check.c index 4473e008f..33bc7074a 100644 --- a/src/check.c +++ b/src/check.c @@ -1088,6 +1088,11 @@ int wake_srv_chk(struct stconn *sc) ret = -1; task_wakeup(check->task, TASK_WOKEN_IO); } + else { + /* Check in progress. Queue it to eventually handle timeout + * update */ + task_queue(check->task); + } if (check->server) HA_SPIN_UNLOCK(SERVER_LOCK, &check->server->lock);