From: Masamichi Hosoda Date: Fri, 6 Aug 2021 14:14:16 +0000 (+0900) Subject: Fix connection pool with fewer connections than spare setting (#4174) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d732a465a960278058f7e4cb6ad0c2acde8b60c0;p=thirdparty%2Ffreeradius-server.git Fix connection pool with fewer connections than spare setting (#4174) The number of connections in the connection pool was not increased when it is less than the spare setting. In v4.0.x, unlike v3.0.x, `pool->max_pending` is a configurable value, with a default value of zero. Therefore, in the default setting, the conditional expression `pool->state.pending >= pool->max_pending` always is true and the number of connections is not increased. This commit fixes it by using `pool->pending_window` instead of `pool->max_pending`. --- diff --git a/src/lib/server/pool.c b/src/lib/server/pool.c index daed1615fa6..bfe6b4c4dd3 100644 --- a/src/lib/server/pool.c +++ b/src/lib/server/pool.c @@ -762,7 +762,7 @@ static int connection_check(fr_pool_t *pool, request_t *request) /* * Don't open too many pending connections. */ - if (pool->state.pending >= pool->max_pending) goto manage_connections; + if (pool->state.pending >= pool->pending_window) goto manage_connections; /* * Don't open too many connections, even if we