diff --git a/src/knot/events/handlers/notify.c b/src/knot/events/handlers/notify.c index 45be77883bce17e44ae589b6158bc807e6f91078..786c501176c53bd97476af801ada0e20283d948a 100644 --- a/src/knot/events/handlers/notify.c +++ b/src/knot/events/handlers/notify.c @@ -195,7 +195,14 @@ int event_notify(conf_t *conf, zone_t *zone) if (failed) { notifailed_rmt_dynarray_sort_dedup(&zone->notifailed); - zone_events_schedule_at(zone, ZONE_EVENT_NOTIFY, time(NULL) + 10); // FIXME exponential backoff of NOTIFY retries + + uint32_t retry_in = knot_soa_retry(soa.rrs.rdata); + conf_val_t val = conf_zone_get(conf, C_RETRY_MIN_INTERVAL, zone->name); + retry_in = MAX(retry_in, conf_int(&val)); + val = conf_zone_get(conf, C_RETRY_MAX_INTERVAL, zone->name); + retry_in = MIN(retry_in, conf_int(&val)); + + zone_events_schedule_at(zone, ZONE_EVENT_NOTIFY, time(NULL) + retry_in); } return failed ? KNOT_ERROR : KNOT_EOK; diff --git a/tests-extra/tests/notify/retry/test.py b/tests-extra/tests/notify/retry/test.py index 5ffb932766a5fa2e979f3e1f605dd6cb5e12568a..7af57000d068bf443303a5b303133b4712c3b20d 100644 --- a/tests-extra/tests/notify/retry/test.py +++ b/tests-extra/tests/notify/retry/test.py @@ -17,6 +17,8 @@ t.link(zone, master, slave1) t.link(zone, master, slave2) t.link(zone, master, slave3) +master.zones[zone[0].name].retry_max = 10 + t.start() serial = master.zone_wait(zone)