Adjust UDP timeouts used in zone maintenance

Drop timeout before resending a UDP request from 15 seconds to 5
seconds and add 1 second to the total time to allow for the reply
to the third request to arrive.  This will speed up the time it
takes for named to recover from a lost packet when refreshing a
zone and for it to determine that a primary is down.
This commit is contained in:
Mark Andrews 2023-08-16 14:40:12 +10:00
parent 85ee12f60e
commit 29f399797d

View file

@ -12205,11 +12205,11 @@ notify_send_toaddr(void *arg) {
result = ISC_R_NOTIMPLEMENTED;
goto cleanup_key;
}
udptimeout = 15;
udptimeout = 5;
if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_DIALNOTIFY)) {
udptimeout = 30;
}
timeout = 3 * udptimeout;
timeout = 3 * udptimeout + 1;
again:
if ((notify->flags & DNS_NOTIFY_TCP) != 0) {
options |= DNS_REQUESTOPT_TCP;
@ -14089,14 +14089,14 @@ again:
}
zone_iattach(zone, &(dns_zone_t *){ NULL });
timeout = 15;
timeout = 5;
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_DIALREFRESH)) {
timeout = 30;
}
result = dns_request_create(
zone->view->requestmgr, message, &zone->sourceaddr, &curraddr,
NULL, NULL, options, key, timeout * 3, timeout, 2, zone->loop,
refresh_callback, zone, &zone->request);
NULL, NULL, options, key, timeout * 3 + 1, timeout, 2,
zone->loop, refresh_callback, zone, &zone->request);
if (result != ISC_R_SUCCESS) {
zone_idetach(&(dns_zone_t *){ zone });
zone_debuglog(zone, __func__, 1,
@ -14354,7 +14354,7 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) {
POST(result);
goto cleanup;
}
timeout = 15;
timeout = 5;
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_DIALREFRESH)) {
timeout = 30;
}
@ -14372,8 +14372,8 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) {
result = dns_request_create(
zone->view->requestmgr, message, &zone->sourceaddr, &curraddr,
NULL, NULL, DNS_REQUESTOPT_TCP, key, timeout * 3, timeout, 2,
zone->loop, stub_callback, cb_args, &zone->request);
NULL, NULL, DNS_REQUESTOPT_TCP, key, timeout * 3 + 1, timeout,
2, zone->loop, stub_callback, cb_args, &zone->request);
if (result != ISC_R_SUCCESS) {
zone_debuglog(zone, __func__, 1,
"dns_request_create() failed: %s",
@ -20640,11 +20640,11 @@ checkds_send_toaddr(void *arg) {
dns_zone_log(checkds->zone, ISC_LOG_DEBUG(3),
"checkds: create request for DS query to %s", addrbuf);
timeout = 15;
timeout = 5;
options |= DNS_REQUESTOPT_TCP;
result = dns_request_create(
checkds->zone->view->requestmgr, message, &src, &checkds->dst,
NULL, NULL, options, key, timeout * 3, timeout, 2,
NULL, NULL, options, key, timeout * 3 + 1, timeout, 2,
checkds->zone->loop, checkds_done, checkds, &checkds->request);
if (result != ISC_R_SUCCESS) {
dns_zone_log(checkds->zone, ISC_LOG_DEBUG(3),