2026. [bug] Rate limit the two recursive client exceeded messages.
[RT #16044]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: query.c,v 1.285 2006/05/16 03:10:23 marka Exp $ */
|
||||
/* $Id: query.c,v 1.286 2006/05/18 03:12:36 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -2958,17 +2958,31 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
|
||||
result = isc_quota_attach(&ns_g_server->recursionquota,
|
||||
&client->recursionquota);
|
||||
if (result == ISC_R_SOFTQUOTA) {
|
||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||
NS_LOGMODULE_QUERY, ISC_LOG_WARNING,
|
||||
"recursive-clients soft limit exceeded, "
|
||||
"aborting oldest query");
|
||||
static isc_stdtime_t last = 0;
|
||||
isc_stdtime_t now;
|
||||
isc_stdtime_get(&now);
|
||||
if (now != last) {
|
||||
last = now;
|
||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||
NS_LOGMODULE_QUERY,
|
||||
ISC_LOG_WARNING,
|
||||
"recursive-clients soft limit "
|
||||
"exceeded, aborting oldest query");
|
||||
}
|
||||
ns_client_killoldestquery(client);
|
||||
result = ISC_R_SUCCESS;
|
||||
} else if (result == ISC_R_QUOTA) {
|
||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||
NS_LOGMODULE_QUERY, ISC_LOG_WARNING,
|
||||
"no more recursive clients: %s",
|
||||
isc_result_totext(result));
|
||||
static isc_stdtime_t last = 0;
|
||||
isc_stdtime_t now;
|
||||
isc_stdtime_get(&now);
|
||||
if (now != last) {
|
||||
last = now;
|
||||
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
|
||||
NS_LOGMODULE_QUERY,
|
||||
ISC_LOG_WARNING,
|
||||
"no more recursive clients: %s",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
ns_client_killoldestquery(client);
|
||||
}
|
||||
if (result == ISC_R_SUCCESS && !client->mortal &&
|
||||
|
||||
Reference in New Issue
Block a user