MINOR: quic: do not crash on unhandled sendto error
Remove ABORT_NOW() statement on unhandled sendto error. Instead use a
dedicated counter sendto_err_unknown to report these cases.
If we detect increment of this counter, strace can be used to detect
errno value :
$ strace -p $(pidof haproxy) -f -e trace=sendto -Z
This should be backported up to 2.6.
This should help to debug github issue #1903.
diff --git a/src/quic_sock.c b/src/quic_sock.c
index 8617489..29f30cc 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -536,14 +536,14 @@
} while (ret < 0 && errno == EINTR);
if (ret < 0 || ret != sz) {
+ struct proxy *prx = qc->li->bind_conf->frontend;
+ struct quic_counters *prx_counters =
+ EXTRA_COUNTERS_GET(prx->extra_counters_fe,
+ &quic_stats_module);
+
/* TODO adjust errno for UDP context. */
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == ENOTCONN || errno == EINPROGRESS || errno == EBADF) {
- struct proxy *prx = qc->li->bind_conf->frontend;
- struct quic_counters *prx_counters =
- EXTRA_COUNTERS_GET(prx->extra_counters_fe,
- &quic_stats_module);
-
if (errno == EAGAIN || errno == EWOULDBLOCK)
HA_ATOMIC_INC(&prx_counters->socket_full);
else
@@ -551,7 +551,7 @@
}
else if (errno) {
/* TODO unlisted errno : handle it explicitly. */
- ABORT_NOW();
+ HA_ATOMIC_INC(&prx_counters->sendto_err_unknown);
}
return 1;