]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stconn: Don't report blocked sends during connection establishment
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Aug 2023 08:56:21 +0000 (10:56 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 1 Sep 2023 12:18:26 +0000 (14:18 +0200)
The server timeout must not be handled during the connection establishment
to not superseed the connect timeout. To do so, we must not consider
outgoing data are blocked during this stage. Concretly, it means the fsb
time must not be updated during connection establishment.

It is not an issue with regular clients because the server timeout is only
defined when the connection is estalished. However, it may be an issue for the
HTTP client, when the server timeout is lower than the connect timeout. In this
case, an early 502 may be reported with no connection retries.

This patch must be backported to 2.8.

src/stconn.c

index e4d876cc51ab8ec3a2ad08d3a719d642d89ab0ad..c30a8dddd569733701611f003e0645f778d4bafb 100644 (file)
@@ -1692,9 +1692,11 @@ static int sc_conn_send(struct stconn *sc)
        else {
                /* 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);
-               sc_ep_report_blocked_send(sc);
-               s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc));
-               task_queue(s->task);
+               if (sc_state_in(sc->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO)) {
+                       sc_ep_report_blocked_send(sc);
+                       s->task->expire = tick_first(s->task->expire, sc_ep_snd_ex(sc));
+                       task_queue(s->task);
+               }
        }
 
        return did_send;