]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: servers: Don't add an incomplete conn to the server idle list.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 29 Jan 2019 15:05:02 +0000 (16:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Jan 2019 18:47:20 +0000 (19:47 +0100)
If we failed to add the connection to the session, only try to add it back
to the server idle list if it has a mux, otherwise the connection is
incomplete and unusable.

This should be backported to 1.9.

src/backend.c

index 26dcccff1476b9d37ccfbe11d52d07400c3f2016..82c71c4febb7f4a4301f64b7492cd5a725797a37 100644 (file)
@@ -1356,7 +1356,7 @@ int connect_server(struct stream *s)
                        if (alloced_cs)
                                si_release_endpoint(&s->si[1]);
                        srv_conn->owner = NULL;
-                       if (!srv_add_to_idle_list(objt_server(srv_conn->target), srv_conn))
+                       if (srv_conn->mux && !srv_add_to_idle_list(objt_server(srv_conn->target), srv_conn))
                        /* The server doesn't want it, let's kill the connection right away */
                                srv_conn->mux->destroy(srv_conn);
                        srv_conn = NULL;