]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: checks: refine which errno values are really errors.
authorWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 11:03:27 +0000 (12:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Dec 2019 13:04:33 +0000 (14:04 +0100)
commitc8dc20a825644bb4003ecb62e0eb2d20c8eaf6c8
treeda9216999b6ef1579a3f3ba7ba5233eb125ed814
parent7aed6ef8e3f64d1d90fac38d50d4c7f5b44428f7
BUG/MINOR: checks: refine which errno values are really errors.

Two regtest regularly fail in a random fashion depending on the machine's
load (one could really wonder if it's really worth keeping such
unreproducible tests) :
  - tcp-check_multiple_ports.vtc
  - 4be_1srv_smtpchk_httpchk_layer47errors.vtc

It happens that one of the reason is the time it takes to connect to
the local socket (hence the load-dependent aspect): if connect() on the
loopback returns EINPROGRESS then this status is reported instead of a
real error. Normally such a test is expected to see the error cleaned
by tcp_connect_probe() but it really depends on the timing and instead
we may very well send() first and see this error. The problem is that
everything is collected based on errno, hoping it won't get molested
in the way from the last unsuccesful syscall to wake_srv_chk(), which
obviously is hard to guarantee.

This patch at least makes sure that a few non-errors are reported as
zero just like EAGAIN. It doesn't fix the root cause but makes it less
likely to report incorrect failures.

This fix could be backported as far as 1.9.
src/checks.c