mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-21 01:15:17 -04:00
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. |
||
|---|---|---|
| .. | ||
| 1be_40srv_odd_health_checks.vtc | ||
| 4be_1srv_health_checks.vtc | ||
| 4be_1srv_smtpchk_httpchk_layer47errors.vtc | ||
| 40be_2srv_odd_health_checks.vtc | ||
| agent-check.vtc | ||
| certs | ||
| healthcheck-section.vtc | ||
| http-check-expect.vtc | ||
| http-check-send.vtc | ||
| http-check.vtc | ||
| http-monitor-uri.vtc | ||
| ldap-check.vtc | ||
| mysql-check.vtc | ||
| pgsql-check.vtc | ||
| redis-check.vtc | ||
| smtp-check.vtc | ||
| spop-check.vtc | ||
| ssl-hello-check.vtc | ||
| tcp-check-client-hello.vtc | ||
| tcp-check-ssl.vtc | ||
| tcp-check_min-recv.vtc | ||
| tcp-check_multiple_ports.vtc | ||
| tcp-checks-socks4.vtc | ||
| tls_health_checks.vtc | ||
| unique_id.vtc | ||