]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: stop polling for write when we have nothing left to send
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Sep 2019 16:24:46 +0000 (18:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 Sep 2019 06:13:15 +0000 (08:13 +0200)
Since the change of I/O direction, we perform the connect() call and
the send() call together from the top. But the send call must at least
disable polling for writes once it does not have anything left to send.

This bug is partially responsible for the waste of resources described
in issue #253.

This must be backported to 2.0.

src/checks.c

index ff39b4f6433ab764224fb5f676aabbc5099e8976..4a60c414d0f64a144c98f5974b967c384b3b5435 100644 (file)
@@ -791,6 +791,9 @@ static void __event_srv_chk_w(struct conn_stream *cs)
                }
        }
 
+       if (!b_data(&check->bo))
+               conn_xprt_stop_send(conn);
+
        /* full request sent, we allow up to <timeout.check> if nonzero for a response */
        if (s->proxy->timeout.check) {
                t->expire = tick_add_ifset(now_ms, s->proxy->timeout.check);