From: Willy Tarreau Date: Fri, 25 May 2012 05:41:38 +0000 (+0200) Subject: BUG/MINOR: checks: expire on timeout.check if smaller than timeout.connect X-Git-Tag: v1.5-dev12~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e44a49c8973f08ee1e35d8737f4677db11cf7ab;p=thirdparty%2Fhaproxy.git BUG/MINOR: checks: expire on timeout.check if smaller than timeout.connect It happens that haproxy doesn't displace the task in the wait queue when validating a connection, so if the check timeout is set to a smaller value than timeout.connect, it will not strike before timeout.connect. The bug is present at least in 1.4.15..1.4.21, so the fix must be backported. --- diff --git a/src/checks.c b/src/checks.c index febf77e7b7..03354a7ce1 100644 --- a/src/checks.c +++ b/src/checks.c @@ -793,8 +793,10 @@ static int event_srv_chk_w(int fd) ret = send(fd, check_req, check_len, MSG_DONTWAIT | MSG_NOSIGNAL); if (ret == check_len) { /* we allow up to if nonzero for a responce */ - if (s->proxy->timeout.check) + if (s->proxy->timeout.check) { t->expire = tick_add_ifset(now_ms, s->proxy->timeout.check); + task_queue(t); + } EV_FD_SET(fd, DIR_RD); /* prepare for reading reply */ goto out_nowake; }