]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: checks: Don't blindly subscribe for receive if waiting for connect
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 May 2020 11:58:34 +0000 (13:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 May 2020 13:07:20 +0000 (15:07 +0200)
commit030ed4b73873e1d93d887d679e65b9e851ec3b1e
treee8280894b54fe8acf919dc263c43364dc4395a17
parent0bac4cdf1a1aa27b62c5dc2717dfd64f4c0c8d92
BUG/MEDIUM: checks: Don't blindly subscribe for receive if waiting for connect

When an health check is waiting for a connection establishment, it subscribe for
receive or send events, depending on the next rule to be evaluated. For
subscription for send events, there is no problem. It works as expected. For
subscription for receive events, It only works for HTTP checks because the
underlying multiplexer takes care to do a receive before subscribing again,
updating the fd state. For TCP checks, the PT multiplexer only forwards
subscriptions at the transport layer. So the check itself is woken up. This
leads to a subscribe/notify loop waiting the connection establishment or a
timeout, uselessly eating CPU.

Thus, when a check is waiting for a connect, instead of blindly resubscribe for
receive events when it is woken up, we now try to receive data.

This patch should fix the issue #635. No backport needed.
src/checks.c