]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: rhttp: add log on connection allocation failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 May 2024 14:35:11 +0000 (16:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 May 2024 08:01:57 +0000 (10:01 +0200)
Add an error log when new_reverse_conn() fails. This may help to
diagnose future issues on reverse HTTP.

src/proto_rhttp.c

index 2f1004cde8cbf84e89a34ca6f26fb684868da18e..05611e0e538dece3e177d1160a68fbabf51d78e8 100644 (file)
@@ -104,6 +104,13 @@ static struct connection *new_reverse_conn(struct listener *l, struct server *sr
        return conn;
 
  err:
+       if (l->rx.rhttp.state != LI_PRECONN_ST_ERR) {
+               send_log(l->bind_conf->frontend, LOG_ERR,
+                        "preconnect %s::%s: Error on conn allocation.\n",
+                        l->bind_conf->frontend->id, l->bind_conf->rhttp_srvname);
+               l->rx.rhttp.state = LI_PRECONN_ST_ERR;
+       }
+
        if (conn) {
                conn_stop_tracking(conn);
                conn_xprt_shutw(conn);