]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: release conn after shutdown on BE reuse failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 30 Jul 2025 07:51:21 +0000 (09:51 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 30 Jul 2025 08:04:19 +0000 (10:04 +0200)
On stream detach on backend side, connection is inserted in the proper
server/session list to be able to reuse it later. If insertion fails and
the connection is idle, the connection can be removed immediately.

If this occurs on a QUIC connection, QUIC MUX implements graceful
shutdown to ensure the server is notified of the closure. However, the
connection instance is not freed. Change this to ensure that both
shutdown and release is performed.

src/mux_quic.c

index 1a0db225c360ec23bc6c653f525df6cac32fe51e..cd014db233851af2465a53b3cf56ac38dbdd887e 100644 (file)
@@ -3791,10 +3791,8 @@ static void qmux_strm_detach(struct sedesc *sd)
                        if (!session_add_conn(sess, conn, conn->target)) {
                                TRACE_ERROR("error during connection insert into session list", QMUX_EV_STRM_END, conn);
                                conn->owner = NULL;
-                               if (!qcc->nb_sc) {
-                                       qcc_shutdown(qcc);
-                                       goto end;
-                               }
+                               if (!qcc->nb_sc)
+                                       goto release;
                        }
 
                        /* If conn is idle, check if session can keep it. Conn is freed if this is not the case.
@@ -3812,8 +3810,9 @@ static void qmux_strm_detach(struct sedesc *sd)
                                if (!srv_add_to_idle_list(objt_server(conn->target), conn, 1)) {
                                        /* Idle conn insert failure, gracefully close the connection. */
                                        TRACE_DEVEL("idle connection cannot be kept on the server", QMUX_EV_STRM_END, conn);
-                                       qcc_shutdown(qcc);
+                                       goto release;
                                }
+
                                goto end;
                        }
                        else if (!conn->hash_node->node.node.leaf_p &&