]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stconn: Propagate error on the SC on sending path
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Apr 2023 16:38:32 +0000 (18:38 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Apr 2023 16:57:04 +0000 (18:57 +0200)
On sending path, a pending error can be promoted to a terminal error at the
endpoint level (SE_FL_ERR_PENDING to SE_FL_ERROR). When this happens, we
must propagate the error on the SC to be able to handle it at the stream
level and eventually forward it to the other side.

Because of this bug, it is possible to freeze sessions, for instance on the
CLI.

It is a 2.8-specific issue. No backport needed.

src/stconn.c

index 0cfc4a7e3c815245126ecdab3f19a37f80aa4ba1..59d2179ace2787ca863cb9c700fd77c9afb3b50f 100644 (file)
@@ -1664,6 +1664,8 @@ static int sc_conn_send(struct stconn *sc)
        if (sc_ep_test(sc, SE_FL_ERROR | SE_FL_ERR_PENDING)) {
                oc->flags |= CF_WRITE_EVENT;
                BUG_ON(sc_ep_test(sc, SE_FL_EOS|SE_FL_ERROR|SE_FL_ERR_PENDING) == (SE_FL_EOS|SE_FL_ERR_PENDING));
+               if (sc_ep_test(sc, SE_FL_ERROR))
+                       sc->flags |= SC_FL_ERROR;
                return 1;
        }