]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Recalculate requests per connection when a request enters the backlog
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 6 Dec 2019 11:45:05 +0000 (18:45 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 7 Dec 2019 05:36:35 +0000 (12:36 +0700)
src/lib/server/trunk.c

index 2449a3d89eb053ac46413d545db04f2efe380480..8a100c723d0ded98357417d66e9c9401f7e6bd0b 100644 (file)
@@ -712,6 +712,13 @@ static void trunk_request_enter_backlog(fr_trunk_request_t *treq)
        REQUEST_STATE_TRANSITION(FR_TRUNK_REQUEST_BACKLOG);
        fr_heap_insert(trunk->backlog, treq);   /* Insert into the backlog heap */
 
+       /*
+        *      New requests in the backlog alters the
+        *      ratio of requests to connections, so we
+        *      need to recalculate.
+        */
+       trunk_requests_per_connnection(NULL, NULL, trunk, fr_time());
+
        /*
         *      To reduce latency, if there's no connections
         *      in the connecting state, call the trunk manage