From 3083fd90e1349692f9255303520a7383aa6012e7 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 10 Oct 2023 18:07:29 +0200 Subject: [PATCH] BUG/MEDIUM: stconn: Report a send activity everytime data were sent When read/write timeouts were refactored in 2.8, we decided to change when a send activity had to be reported. Before, everytime some data were sent a send activity were reported. At this time, the channel's wex timer were updated. During the refactoring, we decided to limit send activity to sends that ampty te channel's buffer, consuming all outgoing data. Idea behind this change was to protect haproxy against clients consumming data very slowly. However, it is too strict. Some congested muxes but still active can hit the client or the server timeout. It seems a bit unfair. It is especially visible with QUIC/H3 but it is probably also possible with H2 if the window size is small. The better is to restore the old behavior. This patch must be backported to 2.8. --- src/stconn.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stconn.c b/src/stconn.c index eaf6d2b383..fbfebc7a59 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1691,6 +1691,11 @@ static int sc_conn_send(struct stconn *sc) oc->flags |= CF_WRITE_EVENT | CF_WROTE_DATA; if (sc->state == SC_ST_CON) sc->state = SC_ST_RDY; + sc_ep_report_send_activity(sc); + } + else { + if (sc_state_in(sc->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) + sc_ep_report_blocked_send(sc); } if (!sco->room_needed || (did_send && (sco->room_needed < 0 || channel_recv_max(sc_oc(sc)) >= sco->room_needed))) @@ -1704,13 +1709,9 @@ static int sc_conn_send(struct stconn *sc) return 1; } - if (channel_is_empty(oc)) - sc_ep_report_send_activity(sc); - else { + if (!channel_is_empty(oc)) { /* We couldn't send all of our data, let the mux know we'd like to send more */ conn->mux->subscribe(sc, SUB_RETRY_SEND, &sc->wait_event); - if (sc_state_in(sc->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) - sc_ep_report_blocked_send(sc); } return did_send; -- 2.39.5