From: Willy Tarreau Date: Thu, 2 Nov 2017 14:45:00 +0000 (+0100) Subject: BUG/MEDIUM: checks/mux: always enable send-polling after connecting X-Git-Tag: v1.8-rc2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16257f648ffb49f639bb17956445acf934b992a7;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/checks.c b/src/checks.c index 0b72bb21d7..aaee9c960c 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);