From: Olivier Houchard Date: Wed, 5 Jun 2019 11:55:01 +0000 (+0200) Subject: BUG/MEDIUM: servers: Don't attempt to destroy idle connections if disabled. X-Git-Tag: v2.0-dev6~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14fcc2ebcc4bae13b35db497a4b147dd0f85b8e5;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: servers: Don't attempt to destroy idle connections if disabled. In connect_server(), when deciding if we should attempt to remove idle connections, because we have to many file descriptors opened, don't attempt to do so if idle connection pool is disabled (with pool-max-conn 0), as if it is, srv->idle_orphan_conns won't even be allocated, and trying to dereference it will cause a crash. --- diff --git a/src/backend.c b/src/backend.c index a9e20e0782..cfd24625c7 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1335,8 +1335,8 @@ int connect_server(struct stream *s) reuse = 0; } } - if ((!reuse || (srv_conn && !(srv_conn->flags & CO_FL_CONNECTED))) - && ha_used_fds > global.tune.pool_high_count) { + if (((!reuse || (srv_conn && !(srv_conn->flags & CO_FL_CONNECTED))) + && ha_used_fds > global.tune.pool_high_count) && srv->idle_orphan_conns) { struct connection *tokill_conn; /* We can't reuse a connection, and e have more FDs than deemd