]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Print WARNING if we fall below "min" connections
authorAlan T. DeKok <aland@freeradius.org>
Sun, 6 Nov 2011 10:02:44 +0000 (11:02 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 6 Nov 2011 10:02:44 +0000 (11:02 +0100)
We want to close idle sessions, sessions with max lifetime
or max uses.  BUT we want to enforce "min".  The code will
currently close a connection, notice "num < min", and spawn
a new one.  We warn the user that this is happening, so that
they can fix their configuration.

src/main/connection.c

index 458bb34d819b476e8b89d754cae868b037820991..af51d51426cccb69bd8625f5b092d54335aeadb2 100644 (file)
@@ -364,6 +364,11 @@ static int fr_connection_manage(fr_connection_pool_t *fc,
                DEBUG("%s: Closing expired connection (%i): Hit max_uses limit",
                        fc->log_prefix, this->number);
        do_delete:
+               if ((fc->num <= fc->min) &&
+                   (fc->last_complained < now)) {
+                       radlog(L_INFO, "WARNING in %s: You probably need to lower \"min\"", fc->log_prefix);
+                       fc->last_complained = now;
+               }
                fr_connection_close(fc, this);
                return 0;
        }