From: Alan T. DeKok Date: Sat, 10 Sep 2011 18:04:20 +0000 (+0200) Subject: Limit complaints to 1/s, not 1/packet X-Git-Tag: release_2_1_12~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bfe5e581f00c1aaa1e339feb872a8d13403f27b;p=thirdparty%2Ffreeradius-server.git Limit complaints to 1/s, not 1/packet --- diff --git a/src/main/threads.c b/src/main/threads.c index c19101afa06..494c47d061b 100644 --- a/src/main/threads.c +++ b/src/main/threads.c @@ -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; }