daemon->respip_set = NULL;
views_delete(daemon->views);
daemon->views = NULL;
+ auth_zones_delete(daemon->env->auth_zones);
+ daemon->env->auth_zones = NULL;
/* key cache is cleared by module desetup during next daemon_fork() */
daemon_remote_clear(daemon->rc);
for(i=0; i<daemon->num; i++)
rrset_cache_delete(daemon->env->rrset_cache);
infra_delete(daemon->env->infra_cache);
edns_known_options_delete(daemon->env);
- auth_zones_delete(daemon->env->auth_zones);
}
ub_randfree(daemon->rand);
alloc_clear(&daemon->superalloc);
comm_timer_set(worker->env.probe_timer, &tv);
}
}
+ /* zone transfer tasks, setup once per process, if any */
+ if(worker->env.auth_zones
+#ifndef THREADS_DISABLED
+ && worker->thread_num == 0
+#endif
+ ) {
+ auth_xfer_pickup_initial(worker->env.auth_zones, &worker->env);
+ }
if(!worker->env.mesh || !worker->env.scratch_buffer) {
worker_delete(worker);
return 0;
#define AUTH_PROBE_TIMEOUT_STOP 1000 /* msec */
/* auth transfer timeout for TCP connections, in msec */
#define AUTH_TRANSFER_TIMEOUT 10000 /* msec */
+/* auth transfer max backoff for failed tranfers and probes */
+#define AUTH_TRANSFER_MAX_BACKOFF 86400 /* sec */
/** pick up nextprobe task to start waiting to perform transfer actions */
static void xfr_set_timeout(struct auth_xfer* xfr, struct module_env* env,
if(xfr->expiry < wait)
xfr->task_nextprobe->next_probe += xfr->expiry;
else xfr->task_nextprobe->next_probe += wait;
+ if(!failure) xfr->task_nextprobe->backoff = 0;
+ } else {
+ if(!failure) {
+ xfr->task_nextprobe->backoff = 0;
+ } else {
+ if(xfr->task_nextprobe->backoff == 0)
+ xfr->task_nextprobe->backoff = 3;
+ else xfr->task_nextprobe->backoff *= 2;
+ if(xfr->task_nextprobe->backoff >
+ AUTH_TRANSFER_MAX_BACKOFF)
+ xfr->task_nextprobe->backoff =
+ AUTH_TRANSFER_MAX_BACKOFF;
+ }
+ xfr->task_nextprobe->next_probe +=
+ xfr->task_nextprobe->backoff;
}
if(!xfr->task_nextprobe->timer) {
/* module env for this task */
struct module_env* env;
+ /** increasing backoff for failures */
+ time_t backoff;
/** Timeout for next probe (for SOA) */
time_t next_probe;
/** timeout callback for next_probe or expiry(if that is sooner).
int auth_zones_apply_cfg(struct auth_zones* az, struct config_file* cfg,
int setup);
+/** initial pick up of worker timeouts, ties events to worker event loop
+ * @param az: auth zones structure
+ * @param env: worker env, of first worker that receives the events (if any)
+ * in its eventloop.
+ */
+void auth_xfer_pickup_initial(struct auth_zones* az, struct module_env* env);
+
/**
* Delete auth zones structure
*/