From: Mark Andrews Date: Fri, 26 Jul 2002 06:27:31 +0000 (+0000) Subject: 1340. [bug] Delay and spread out the startup refresh load. X-Git-Tag: v9.2.3rc1~104^2~452 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f6ff00810196d0c0973f62c7917b9975011fa45a;p=thirdparty%2Fbind9.git 1340. [bug] Delay and spread out the startup refresh load. --- diff --git a/CHANGES b/CHANGES index 6d6aae97719..7857541c147 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1340. [bug] Delay and spread out the startup refresh load. + 1339. [func] dig, host and nslookup now use IP6.ARPA for nibble lookups. Bit string lookups are no longer attempted. diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 4b8017e5bc7..572470fd1ac 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.372 2002/07/19 02:34:56 marka Exp $ */ +/* $Id: zone.c,v 1.373 2002/07/26 06:27:30 marka Exp $ */ #include @@ -1338,6 +1338,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, if (zone->type == dns_zone_slave || zone->type == dns_zone_stub) { isc_time_t t; + isc_uint32_t delay; result = isc_file_getmodtime(zone->journal, &t); if (result != ISC_R_SUCCESS) @@ -1349,7 +1350,13 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, else DNS_ZONE_TIME_ADD(&now, zone->retry, &zone->expiretime); - zone->refreshtime = now; + + delay = isc_random_jitter(zone->retry, + (zone->retry * 3) / 4); + DNS_ZONE_TIME_ADD(&now, delay, &zone->refreshtime); + if (isc_time_compare(&zone->refreshtime, + &zone->expiretime) >= 0) + zone->refreshtime = now; } break; default: