From: Christopher Faulet Date: Tue, 10 Oct 2023 16:07:29 +0000 (+0200) Subject: BUG/MEDIUM: stconn: Report a send activity everytime data were sent X-Git-Tag: v2.9-dev8~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3083fd90e;p=thirdparty%2Fhaproxy.git 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. --- 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;