Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 61d17267 authored by Mike Yu's avatar Mike Yu
Browse files

Support prioritizing DNS servers

The change introduces a way to prioritize DNS servers on the basis of
DNS query response time, which aims to replace the current design that
is biased towards using the first DNS server assigned from networks.

The quality is evaluated based on the heuristics:
  - The more latency it is, the less likely it is used.
  - The longer time it is not used, the more likely it is used.

Compared to the current design, the proposed method detects bad DNS
servers more quickly. For instance, a server which is unreachable or
times out can be detected and deprioritized with few trials by backoff
penalty and abnormal latency.

Similar to the current design, a server which has been regarded as bad
quality can be used again, but it depends on how much worse it is. A
counter is used to count how many times a DNS server not being used,
which avoids from constantly using the same DNS server.

This change comprises:

[1] Allow the resolver to sort DNS servers on the basis of DNS query
    response time.
[2] Add an experiment flag to enable/disable the sorting.
[3] Show the result of the quantified quality of DNS servers in
    dumpsys dnsresolver.
[4] Add unit tests for DnsStats::getSortedServers().
[5] Revise the integration tests which are sensitive to the nameserver
    sorting, including two big changes in SkipBadServersDueToInternalError
    and SkipBadServersDueToTimeout and some minor changes.

Bug: 137169582
Test: ran resolv_unit_test
      ran resolv_integration_test with the sorting enabled
      ran resolv_integration_test with the sorting disabled
Change-Id: I24b6a317f135a942ce0ea310c81dfe658bada6a7
parent 6ce587d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment