mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
BUG/MINOR: server: Be really able to keep "pool-max-conn" idle connections
The maximum number of idle connections for a server can be configured by setting the server option "pool-max-conn". But when we try to add a connection in its idle list, because of a wrong comparison, it may be rejected because there are already "pool-max-conn - 1" idle connections. This patch must be backported to 2.0 and 1.9.
This commit is contained in:
parent
1dad3843dc
commit
34ce7d075a
@ -256,7 +256,7 @@ static inline int srv_add_to_idle_list(struct server *srv, struct connection *co
|
|||||||
int retadd;
|
int retadd;
|
||||||
|
|
||||||
retadd = _HA_ATOMIC_ADD(&srv->curr_idle_conns, 1);
|
retadd = _HA_ATOMIC_ADD(&srv->curr_idle_conns, 1);
|
||||||
if (retadd >= srv->max_idle_conns) {
|
if (retadd > srv->max_idle_conns) {
|
||||||
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user