From 2500fc2c3443f69bc05de53d0516da373d2f0cc1 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 3 Apr 2018 19:31:38 +0200 Subject: [PATCH] BUG/MINOR: checks: check the conn_stream's readiness and not the connection Since commit 9aaf778 ("MAJOR: connection : Split struct connection into struct connection and struct conn_stream."), the checks use a conn_stream and not directly the connection anymore. However wake_srv_chk() still used to verify the connection's readiness instead of the conn_stream's. Due to the existence of a mux, the connection is always waiting for receiving something, and doesn't reflect the changes made in event_srv_chk_{r,w}(), causing the connection appear as not ready yet, and the check to be validated only after its timeout. The difference is only visible when sending pure TCP checks, and simply adding a "tcp-check connect" line is enough to work around it. This fix must be backported to 1.8. --- src/checks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checks.c b/src/checks.c index cae2e3e3fa..8e4bc2ccf1 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1394,7 +1394,7 @@ static int wake_srv_chk(struct conn_stream *cs) __cs_stop_both(cs); task_wakeup(check->task, TASK_WOKEN_IO); } - else if (!(conn->flags & (CO_FL_XPRT_RD_ENA|CO_FL_XPRT_WR_ENA|CO_FL_HANDSHAKE))) { + else if (!(conn->flags & CO_FL_HANDSHAKE) && !(cs->flags & (CS_FL_DATA_RD_ENA|CS_FL_DATA_WR_ENA))) { /* we may get here if only a connection probe was required : we * don't have any data to send nor anything expected in response, * so the completion of the connection establishment is enough. -- 2.47.3