]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Limit complaints to 1/s, not 1/packet
authorAlan T. DeKok <aland@freeradius.org>
Sat, 10 Sep 2011 18:04:20 +0000 (20:04 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 10 Sep 2011 18:04:20 +0000 (20:04 +0200)
src/main/threads.c

index c19101afa06932fbfa1dc7de845392ead313f4f5..494c47d061b904d3a13b72f2d651468ff31fb950 100644 (file)
@@ -297,12 +297,24 @@ static int request_enqueue(REQUEST *request, RAD_REQUEST_FUNP fun)
        thread_pool.request_count++;
 
        if (thread_pool.num_queued >= thread_pool.max_queue_size) {
+               int complain = FALSE;
+               time_t now;
+               static time_t last_complained = 0;
+
+               now = time(NLL);
+               if (last_complained != now) {
+                       last_complained = now;
+                       complain = TRUE;
+               }
+                   
                pthread_mutex_unlock(&thread_pool.queue_mutex);
 
                /*
                 *      Mark the request as done.
                 */
-               radlog(L_ERR, "Something is blocking the server.  There are %d packets in the queue, waiting to be processed.  Ignoring the new request.", thread_pool.max_queue_size);
+               if (complain) {
+                       radlog(L_ERR, "Something is blocking the server.  There are %d packets in the queue, waiting to be processed.  Ignoring the new request.", thread_pool.max_queue_size);
+               }
                request->child_state = REQUEST_DONE;
                return 0;
        }