From 16257f648ffb49f639bb17956445acf934b992a7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 2 Nov 2017 15:45:00 +0100 Subject: [PATCH] BUG/MEDIUM: checks/mux: always enable send-polling after connecting Before introducing the mux layer, tcp_connect() would poll for sending to detect the connection establishment. It happens that the health checks have apparently never explicitly enabled this polling and have been relying on this implicit one. Now that there's the mux layer, the conn_stream needs to be enabled for polling as well and since it's not done in the checks, it's never done and the check's request doesn't leave the machine, as can be noticed with http checks. The solution simply consists in going back to the well-known case where we enable polling after connecting using cs_want_send() if we have anything but just a plain connect(). The regular data path is not affected because the stream interface code automatically computes the polling needs based on buffer contents. --- src/checks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/checks.c b/src/checks.c index 0b72bb21d..aaee9c960 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1586,6 +1586,10 @@ static int connect_conn_chk(struct task *t) ret = SF_ERR_INTERNAL; if (proto && proto->connect) ret = proto->connect(conn, check->type, quickack ? 2 : 0); + + if (check->type) + cs_want_send(cs); + #ifdef USE_OPENSSL if (s->check.sni) ssl_sock_set_servername(conn, s->check.sni);