Hi again Kevin,

Well, I suspect that there might be a corner case with the bug I fixed
which might have caused what you observed.

The "timeout connect" is computed from the last expire date. Since
"timeout check" was added upon connection establishment but the task
was woken too late, then that after a first check failure reported
too late, you can have the next check timeout shortened.

It's still unclear to me how it is possible that the check timeout is
reported this small, considering that it's updated once the connect
succeeds. But performing computations in the past is never a good way
to have something reliable.

Could you please apply the attached fix for the bug I mentionned in
previous mail, to see if the issue is still present ? After all, I
would not be totally surprized if this bug has nasty side effects
like this.

Thanks,
Willy
 
>From 78604116c3cbe23987bef94cb0d7aa15e6d4371b Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w...@1wt.eu>
Date: Fri, 25 May 2012 07:41:38 +0200
Subject: [PATCH] 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.
(cherry picked from commit 1e44a49c8973f08ee1e35d8737f4677db11cf7ab)
---
 src/checks.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/checks.c b/src/checks.c
index 7255817..0aa65c0 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -781,8 +781,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 <timeout.check> 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;
                        }
-- 
1.7.2.1.45.g54fbc

Reply via email to