Commit 8cc3e1c2d4 for bind
commit 8cc3e1c2d4a24f214493b58f349f4a008cf464d0
Author: Aram Sargsyan <aram@isc.org>
Date: Thu Oct 8 13:16:25 2026 +0000
Don't run isccc_cc_cleansymtab() too frequently
Running the cleanup on every request has performance issues. The
cleanup function has a one second resolution anyway, so this change
adds code to not run the cleanup function more than once during one
second period.
diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c
index 103f8688ab..bd1c4a99d3 100644
--- a/bin/named/controlconf.c
+++ b/bin/named/controlconf.c
@@ -109,6 +109,7 @@ struct named_controls {
bool shuttingdown;
isc_mutex_t symtab_lock;
isc_symtab_t *symtab;
+ isc_stdtime_t last_cleanup_time;
};
static isc_result_t
@@ -480,7 +481,10 @@ control_recvmessage(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
* Duplicate suppression (required for UDP).
*/
LOCK(&listener->controls->symtab_lock);
- isccc_cc_cleansymtab(listener->controls->symtab, conn->now);
+ if (conn->now > listener->controls->last_cleanup_time) {
+ isccc_cc_cleansymtab(listener->controls->symtab, conn->now);
+ listener->controls->last_cleanup_time = conn->now;
+ }
result = isccc_cc_checkdup(listener->controls->symtab, conn->request,
conn->now);
UNLOCK(&listener->controls->symtab_lock);