Skip to content
Snippets Groups Projects
Commit 9171da0e authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'min_next_refresh' into 'master'

events/xfr: minimum timeout for next refresh

Closes #489

See merge request !654
parents b724c14e b0785d12
1 merge request!654events/xfr: minimum timeout for next refresh
Pipeline #1374 passed with stages
in 8 minutes and 44 seconds
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
#define BOOTSTRAP_MAXTIME (24*60*60) #define BOOTSTRAP_MAXTIME (24*60*60)
#define BOOTSTRAP_JITTER (30) #define BOOTSTRAP_JITTER (30)
#define NEXT_REFRESH_MIN (2)
enum state { enum state {
REFRESH_STATE_INVALID = 0, REFRESH_STATE_INVALID = 0,
...@@ -917,6 +918,11 @@ int event_refresh(conf_t *conf, zone_t *zone) ...@@ -917,6 +918,11 @@ int event_refresh(conf_t *conf, zone_t *zone)
zone->timers.next_refresh = now + next; zone->timers.next_refresh = now + next;
} }
/* Security: avoid flooding master. */
if (zone->timers.next_refresh < now + NEXT_REFRESH_MIN) {
zone->timers.next_refresh = now + NEXT_REFRESH_MIN;
}
/* Rechedule events. */ /* Rechedule events. */
replan_from_timers(conf, zone); replan_from_timers(conf, zone);
if (updated) { if (updated) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment