MINOR: quic: add counter for interrupted reception
Add a new counter "quic_rxbuf_full". It is incremented each time
quic_sock_fd_iocb() is interrupted on full buffer.
This should help to debug github issue #1903. It is suspected that
QUIC receiver buffers are full which in turn cause quic_sock_fd_iocb()
to be called repeatedly resulting in a high CPU consumption.
diff --git a/src/quic_sock.c b/src/quic_sock.c
index 0f8185a..03cb963 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -389,13 +389,17 @@
max_sz = params->max_udp_payload_size;
cspace = b_contig_space(buf);
if (cspace < max_sz) {
+ struct proxy *px = l->bind_conf->frontend;
+ struct quic_counters *prx_counters = EXTRA_COUNTERS_GET(px->extra_counters_fe, &quic_stats_module);
struct quic_dgram *dgram;
/* Do no mark <buf> as full, and do not try to consume it
* if the contiguous remaining space is not at the end
*/
- if (b_tail(buf) + cspace < b_wrap(buf))
+ if (b_tail(buf) + cspace < b_wrap(buf)) {
+ HA_ATOMIC_INC(&prx_counters->rxbuf_full);
goto out;
+ }
/* Allocate a fake datagram, without data to locate
* the end of the RX buffer (required during purging).
@@ -414,8 +418,10 @@
/* Consume the remaining space */
b_add(buf, cspace);
- if (b_contig_space(buf) < max_sz)
+ if (b_contig_space(buf) < max_sz) {
+ HA_ATOMIC_INC(&prx_counters->rxbuf_full);
goto out;
+ }
}
dgram_buf = (unsigned char *)b_tail(buf);