Skip to content

Commit

Permalink
resolved: extend various timeouts
Browse files Browse the repository at this point in the history
Let's increase a number of timeouts as they apparently are too short for
some real-world lookups.

See:

systemd#4003 (comment)

In particular we change the following timeouts:

1) The first UDP retry we increase 500ms → 750ms. This is a good idea,
   since some servers need relatively long responses for trivial lookups,
   and giving up our first attempt also has the effect of trying a
   different server for the next attempt which has the side effect that
   we'll run two down-grade iterations in parallel, on both servers.
   Hence, let's give servers a bit more time in the first iteration.

2) Permit 24 retries instead of just 16 per transactions. If we end up
   downgrading all the way down to UDP for a lookup we already need 5
   iterations for that. If we want permit a couple of lost packages for
   each (let's say 4), then we already need 20 iterations.

3) Increase the overall query timeout on the service side to 60s (from
   45s), simply because very long and slow DNSSEC + CNAME chains (such as
   us.ynuf.alipay.com) hit this boundary too easily. The client side
   timeout for the bus method call is increased to 90s, in order to have
   room for the dbus reply to go through
  • Loading branch information
poettering committed Feb 17, 2017
1 parent 2d4a4e1 commit 74a3ed7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/resolve/resolve-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "strv.h"
#include "terminal-util.h"

#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
#define DNS_CALL_TIMEOUT_USEC (90*USEC_PER_SEC)

static int arg_family = AF_UNSPEC;
static int arg_ifindex = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/resolve/resolved-dns-query.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "string-util.h"

/* How long to wait for the query in total */
#define QUERY_TIMEOUT_USEC (30 * USEC_PER_SEC)
#define QUERY_TIMEOUT_USEC (60 * USEC_PER_SEC)

#define CNAME_MAX 8
#define QUERIES_MAX 2048
Expand Down
2 changes: 1 addition & 1 deletion src/resolve/resolved-dns-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "string-util.h"

/* After how much time to repeat classic DNS requests */
#define DNS_TIMEOUT_MIN_USEC (500 * USEC_PER_MSEC)
#define DNS_TIMEOUT_MIN_USEC (750 * USEC_PER_MSEC)
#define DNS_TIMEOUT_MAX_USEC (5 * USEC_PER_SEC)

/* The amount of time to wait before retrying with a full feature set */
Expand Down
2 changes: 1 addition & 1 deletion src/resolve/resolved-dns-transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ DnsTransactionSource dns_transaction_source_from_string(const char *s) _pure_;
#define MDNS_PROBING_INTERVAL_USEC (250 * USEC_PER_MSEC)

/* Maximum attempts to send DNS requests, across all DNS servers */
#define DNS_TRANSACTION_ATTEMPTS_MAX 16
#define DNS_TRANSACTION_ATTEMPTS_MAX 24

/* Maximum attempts to send LLMNR requests, see RFC 4795 Section 2.7 */
#define LLMNR_TRANSACTION_ATTEMPTS_MAX 3
Expand Down

0 comments on commit 74a3ed7

Please sign in to comment.