]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: connection: add more connection error codes to cover common errno
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Nov 2024 16:49:15 +0000 (17:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Nov 2024 17:57:43 +0000 (18:57 +0100)
commit00c383ff65c6378327382d2c055f66efb098498d
tree9600b63b5fc61069c4a739c10fe76025a85ac20f
parent0f1d37a4794072f53b8eb20a6c770d8cc0a1cefb
MINOR: connection: add more connection error codes to cover common errno

While we get reports of connection setup errors in fc_err/bc_err, we
don't have the equivalent for the recv/send/splice syscalls. Let's
add provisions for new codes that cover the common errno values that
recv/send/splice can return, i.e. ECONNREFUSED, ENOMEM, EBADF, EFAULT,
EINVAL, ENOTCONN, ENOTSOCK, ENOBUFS, EPIPE. We also add a special case
for when the poller reported the error itself. It's worth noting that
EBADF/EFAULT/EINVAL will generally indicate serious bugs in the code
and should not be reported.

The only thing is that it's quite hard to forcefully (and reliably)
trigger these errors in automated tests as the timing is critical.
Using iptables to manually reset established connections in the
middle of large transfers at least permits to see some ECONNRESET
and/or EPIPE, but the other ones are harder to trigger.
doc/configuration.txt
include/haproxy/connection-t.h
include/haproxy/connection.h
src/connection.c