]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1340. [bug] Delay and spread out the startup refresh load.
authorMark Andrews <marka@isc.org>
Fri, 26 Jul 2002 06:27:31 +0000 (06:27 +0000)
committerMark Andrews <marka@isc.org>
Fri, 26 Jul 2002 06:27:31 +0000 (06:27 +0000)
CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 6d6aae977199050b9ef3c1c8dd6e69e3d79c587a..7857541c14770cea7966f9cf9004efbeb36324bd 100644 (file)
--- 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.
 
index 4b8017e5bc720da973becd1091c79203305937f4..572470fd1acdfd67a85eaeb544eea93414fd427e 100644 (file)
@@ -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 <config.h>
 
@@ -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: