notify-delay
------------
-The time delay in seconds before an outgoing NOTIFY message is sent upon loading
-a new zone (e.g. to ensure that secondaries have enough time to adjust their catalogues).
-Set to -1 to prevent sending NOTIFY messages in this context.
+A time delay in seconds before an outgoing NOTIFY message is sent. This delay
+also defines the time granularity at which NOTIFY messages are sent per zone.
*Default:* ``0``
free(zone->control_update);
zone->control_update = NULL;
- zone_schedule_notify(zone, 0);
+ zone_schedule_notify(conf(), zone, 0);
return KNOT_EOK;
}
ZONE_EVENT_DNSKEY_SYNC, refresh->plan_dnskey_sync ? now + jitter : ignore
);
if (zone_changed) {
- zone_schedule_notify(zone, 0);
+ zone_schedule_notify(conf, zone, 0);
}
}
replan_from_timers(conf, zone);
if (!zone_timers_serial_notified(&zone->timers, new_serial)) {
- val = conf_zone_get(conf, C_NOTIFY_DELAY, zone->name);
- int64_t delay = conf_int(&val);
- if (delay >= 0) {
- zone_schedule_notify(zone, delay);
- }
+ zone_schedule_notify(conf, zone, 0);
}
zone_skip_free(&skip);
/* Reschedule events. */
replan_from_timers(conf, zone);
if (trctx.send_notify) {
- zone_schedule_notify(zone, 1);
+ zone_schedule_notify(conf, zone, 1);
}
if (trctx.more_xfr && ret == KNOT_EOK) {
zone_events_schedule_now(zone, ZONE_EVENT_REFRESH);
"%.02f seconds", old_serial, new_serial,
time_diff_ms(&t_start, &t_end) / 1000.0);
- zone_schedule_notify(zone, 1);
+ zone_schedule_notify(conf, zone, 1);
}
static int remote_forward(conf_t *conf, knot_request_t *request, conf_remote_t *remote,
pthread_mutex_unlock(&zone->preferred_lock);
}
-void zone_schedule_notify(zone_t *zone, time_t delay)
+void zone_schedule_notify(conf_t *conf, zone_t *zone, time_t delay)
{
+ conf_val_t val = conf_zone_get(conf, C_NOTIFY_DELAY, zone->name);
+ int64_t conf_delay = conf_int(&val);
zone_notifailed_clear(zone);
- zone_events_schedule_at(zone, ZONE_EVENT_NOTIFY, time(NULL) + delay);
+ zone_events_schedule_at(zone, ZONE_EVENT_NOTIFY, time(NULL) + conf_delay + delay);
}
zone_contents_t *zone_switch_contents(zone_t *zone, zone_contents_t *new_contents)
* \brief Clear failed_notify list before planning new NOTIFY.
*/
void zone_notifailed_clear(zone_t *zone);
-void zone_schedule_notify(zone_t *zone, time_t delay);
+void zone_schedule_notify(conf_t *conf, zone_t *zone, time_t delay);
/*!
* \brief Atomically switch the content of the zone.
s.item_str("storage", self.dir)
s.item_str("zonefile-sync", self.zonefile_sync)
if self.notify_delay is None:
- self.notify_delay = random.randint(0, 2)
+ self.notify_delay = random.randint(0, 1)
s.item_str("notify-delay", self.notify_delay)
if self.zonemd_verify:
s.item_str("zonemd-verify", "on")