From 1c3dd0d0ff4f869faff9e03beb19703ff99ca278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 20 Feb 2024 08:50:58 +0100 Subject: [PATCH] Remove expired rdataset headers from the heap It was discovered that an expired header could sit on top of the heap a little longer than desireable. Remove expired headers (headers with rdh_ttl set to 0) from the heap completely, so they don't block the next TTL-based cleaning. (cherry picked from commit a9383e4b95256a65f9f05e64a79b086a9a1ed035) (cherry picked from commit 756555dbcf8b813942420f8ec059c2df9e543308) --- lib/dns/rbtdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 4239f1ed02..6ec4c5e092 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -904,6 +904,10 @@ set_ttl(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, dns_ttl_t newttl) { } else { isc_heap_decreased(heap, header->heap_index); } + + if (newttl == 0) { + isc_heap_delete(heap, header->heap_index); + } } /*%