haproxy/reg-tests/checks
Willy Tarreau 3da2b63274 BUG/MINOR: sock: store the connection error status
When an async connect() fails in sock_conn_check(), it returns an errno
that will not be retrieved later by a subsequent getsockopt(SO_ERROR).
The problem is that this errno is then definitely lost. This is visible
in the 4be_1srv_smtpchk_httpchk_layer47errors regtest that fails on
certain systems (e.g. glibc 2.31 on arm32 running Linux 6.1), where the
connect() error is systematically lost and the "Connection refused" is
never seen in the check status. It also matches a few random reports of
the past indicating that the connection error was sometimes not reported
in the stats page in front of a down server.

Ideally we should store errno in connections as soon as the error is
seen. However this would require significant changes that are not
acceptable yet for 3.4 nor stable releases. A more acceptable fix is to
make use of the extra CO_ER_* flags set by conn_set_errno() as soon as
the error is detected. This will recognize a sufficiently large number
of errors and the check status will report them (here we'll have
"ECONNREFUSED" in the check). Note that on systems where the error is
seen synchronously, we can have "ECONNREFUSED (Connection refused)",
but this is not a problem.

This fix adds the missing conn_set_errno() call to sock_conn_check(),
that is thus sufficient to catch this error. In addition, the two
affected regtests were updated to search for ECONNREFUSED here.

This might be backported to older releases if users request it, but it
is probably not necessary.
2026-05-18 18:16:25 +02:00
..
1be_40srv_odd_health_checks.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
4be_1srv_health_checks.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
4be_1srv_smtpchk_httpchk_layer47errors.vtc BUG/MINOR: sock: store the connection error status 2026-05-18 18:16:25 +02:00
40be_2srv_odd_health_checks.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
agent-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
certs REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory 2025-12-08 10:40:59 +01:00
healthcheck-section.vtc REGTESTS: tcpcheck: Add a script to check healthcheck section 2026-04-01 16:34:38 +02:00
http-check-expect.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
http-check-send.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
http-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
http-monitor-uri.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
ldap-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
mysql-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
pgsql-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
redis-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
smtp-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
spop-check.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
ssl-hello-check.vtc REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory 2025-12-08 10:40:59 +01:00
tcp-check-client-hello.vtc REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory 2025-12-08 10:40:59 +01:00
tcp-check-ssl.vtc REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory 2025-12-08 10:40:59 +01:00
tcp-check_min-recv.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
tcp-check_multiple_ports.vtc BUG/MINOR: sock: store the connection error status 2026-05-18 18:16:25 +02:00
tcp-checks-socks4.vtc REGTESTS: restrict execution to a single thread group 2025-06-30 18:54:35 +02:00
tls_health_checks.vtc REGTESTS: ssl: Move all the SSL certificates, keys, crt-lists inside "certs" directory 2025-12-08 10:40:59 +01:00
unique_id.vtc MINOR: http_fetch: Add support for checks to unique-id fetch 2026-04-13 20:02:21 +02:00