Commit e25abc9c authored by Marek Vavruša's avatar Marek Vavruša

daemon: fast retransmit address selection

instead of single I/O request per step, the daemon now retries
all addresses in the selection with 300ms timeout between tries.
there are len(list) + len(list)/2 tries

the idea is to reduce latency when UDP request doesn't punch through,
or some NSs are overwhelmed/faulty
parent de701dc3
This diff is collapsed.
......@@ -36,6 +36,7 @@ static inline int __attribute__((__cold__)) kr_error(int x) {
* @cond internal
*/
#define KR_CONN_RTT_MAX 3000 /* Timeout for network activity */
#define KR_CONN_RETRY 300 /* Retry interval for network activity */
#define KR_ITER_LIMIT 50 /* Built-in iterator limit */
/*
......
......@@ -411,12 +411,6 @@ int kr_resolve_consume(struct kr_request *request, const struct sockaddr *src, k
struct kr_query *qry = TAIL(rplan->pending);
bool tried_tcp = (qry->flags & QUERY_TCP);
if (!packet || packet->size == 0) {
/* Network error, retry over TCP. */
if (!tried_tcp) {
DEBUG_MSG(qry, "=> NS unreachable, retrying over TCP\n");
qry->flags |= QUERY_TCP;
return KNOT_STATE_PRODUCE;
}
request->state = KNOT_STATE_FAIL;
} else {
/* Packet cleared, derandomize QNAME. */
......
Markdown is supported
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