]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: connections: Kill connections even if we are reusing one.
authorOlivier Houchard <cognet@ci0.org>
Mon, 16 Mar 2020 12:49:00 +0000 (13:49 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 19 Mar 2020 21:07:34 +0000 (22:07 +0100)
In connect_server(), if we notice we have more file descriptors opened than
we should, there's no reason not to close a connection just because we're
reusing one, so do it anyway.

src/backend.c

index cae3f20c526993fe10870daa833c2fe7a1744090..96d8d17ad8dda012274290ad77ac89818f387f20 100644 (file)
@@ -1256,8 +1256,7 @@ int connect_server(struct stream *s)
                }
        }
 
-       if (((!reuse || (srv_conn && (srv_conn->flags & CO_FL_WAIT_XPRT)))
-           && ha_used_fds > global.tune.pool_high_count) && srv && srv->idle_conns) {
+       if (ha_used_fds > global.tune.pool_high_count && srv && srv->idle_conns) {
                struct connection *tokill_conn;
 
                /* We can't reuse a connection, and e have more FDs than deemd