From 63e74e7efdbce69815d87a472c43a60c9fbeb148 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 29 Jul 2021 09:54:16 -0400 Subject: [PATCH] set extra=0 only when min=max. --- src/main/connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/connection.c b/src/main/connection.c index 412efe1bb3..994367918c 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -677,12 +677,14 @@ static int fr_connection_pool_check(fr_connection_pool_t *pool) /* * But if we're already at "min", then don't spawn more, - * and we don't have any extra idle connections. + * and set extra to zero if there's no possibility for extra. */ } else if ((pool->num + pool->pending) >= pool->min) { spawn = 0; extra = 0; + if (pool->min == pool->max) extra = 0; + /* * If we're about to create more than "max", * don't create more. -- 2.47.3