From: Grigorii Demidov Date: Wed, 5 Dec 2018 10:51:52 +0000 (+0100) Subject: daemon: increase udp timeouts when forwarding X-Git-Tag: v3.2.0~15^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f526993121608b3b535c5f77e2c18ee0c766d298;p=thirdparty%2Fknot-resolver.git daemon: increase udp timeouts when forwarding --- diff --git a/daemon/worker.c b/daemon/worker.c index 04e9599d0..caf4b1dcd 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -987,7 +987,8 @@ static void on_retransmit(uv_timer_t *req) struct qr_task *task = session_tasklist_get_first(session); if (retransmit(task) == NULL) { /* Not possible to spawn request, start timeout timer with remaining deadline. */ - uint64_t timeout = KR_CONN_RTT_MAX - task->pending_count * KR_CONN_RETRY; + uint64_t timeout = task->ctx->req.options.FORWARD ? KR_NS_FWD_TIMEOUT / 2 : + KR_CONN_RTT_MAX - task->pending_count * KR_CONN_RETRY; uv_timer_start(req, on_udp_timeout, timeout, 0); } else { uv_timer_start(req, on_retransmit, KR_CONN_RETRY, 0); diff --git a/lib/nsrep.h b/lib/nsrep.h index 12e9554f3..62996f7f7 100644 --- a/lib/nsrep.h +++ b/lib/nsrep.h @@ -32,7 +32,8 @@ struct kr_query; */ enum kr_ns_score { KR_NS_MAX_SCORE = 20 * KR_CONN_RTT_MAX, /* max possible value */ - KR_NS_FWD_TIMEOUT = 10000, /* timeout for upstream recursor */ + KR_NS_FWD_TIMEOUT = (95 * 10000) / 100, /* timeout for upstream recursor, + * 95 percents from max resolution time */ KR_NS_TIMEOUT = (95 * KR_CONN_RTT_MAX) / 100, /* timeout for upstream auth */ KR_NS_LONG = (3 * KR_NS_TIMEOUT) / 4, KR_NS_UNKNOWN = KR_NS_TIMEOUT / 2,