commit | 473e881eb6ae5b6d593975b6fadb1b5bc479e5fb | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Mon May 31 21:03:31 2021 +0800 |
committer | Mike Yu <yumike@google.com> | Sat Jun 05 23:30:47 2021 +0800 |
tree | bd706fc4af7e3394271c95774e9d44c2c6340d54 | |
parent | 1aede8135e8a227e127f826f38073eba7447c382 [diff] |
Set maximum attempt for opportunistic mode private DNS validation If a private DNS works but it's always too slow to fit the latency threshold, private DNS validation can be endless. To address this problem, limit the number of attempts to three. If a private DNS validation has attempted on three probes, it will finish. Besides, latencyThreshold calculated at the beginning of validation can be too outdated to be useful because of the backoff time which starts with one minute delay. Change the code to update latencyThreshold every time when probe is about to begin. Bug: 188153519 Test: run atest with all the flags off/on avoid_bad_private_dns: 0 / 1 sort_nameservers: 0 / 1 dot_xport_unusable_threshold: -1 / 20 dot_query_timeout_ms: -1 / 10000 min_private_dns_latency_threshold_ms: -1 / 500 keep_listening_udp: 0 / 1 parallel_lookup_sleep_time: 2 / 2 dot_revalidation_threshold: -1 / 10 max_private_dns_latency_threshold_ms: -1 / 2000 dot_async_handshake: 0 / 1 dot_maxtries: 3 / 1 dot_connect_timeout_ms: 127000 / 10000 parallel_lookup_release: UNSET / UNSET Change-Id: I8251681152e4ed72bf5232ab688267e6d92878c4
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.