]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix connection pool with fewer connections than spare setting (#4174)
authorMasamichi Hosoda <trueroad@trueroad.jp>
Fri, 6 Aug 2021 14:14:16 +0000 (23:14 +0900)
committerGitHub <noreply@github.com>
Fri, 6 Aug 2021 14:14:16 +0000 (10:14 -0400)
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`.

src/lib/server/pool.c

index daed1615fa63e3fe73db73e963cc41b6bc4a322a..bfe6b4c4dd333e1acb4e8010af944ead0b0daadf 100644 (file)
@@ -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