]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix unnecessary periodic close/open in connection pools. refs #4161 (#4162)
authorMasamichi Hosoda <trueroad@trueroad.jp>
Thu, 29 Jul 2021 10:57:35 +0000 (19:57 +0900)
committerGitHub <noreply@github.com>
Thu, 29 Jul 2021 10:57:35 +0000 (06:57 -0400)
src/main/connection.c

index 8a1f77a12bfd863bdf81192613d9f2372541d982..d182a07f071271f70d8c919c6931c5f7d8fb9148 100644 (file)
@@ -686,7 +686,14 @@ static int fr_connection_pool_check(fr_connection_pool_t *pool)
                 *      delete all of them.
                 */
                spawn = 0;
-               /* leave extra alone from above */
+               /*
+                *      But if the pool size is already "min", we
+                *      don't delete them.
+                */
+               if ((pool->num + pool->pending) == pool->min) {
+                       extra = 0;
+               }
+               /* Otherwise, leave extra alone from above */
 
        /*
         *      min < num < max