commit | 08b2f2b72e938dc0618b2e04b9ecd984630e0d50 | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Wed Dec 16 11:45:36 2020 +0800 |
committer | Mike Yu <yumike@google.com> | Wed May 05 10:49:45 2021 +0800 |
tree | 19e7c2f55f1d4db361eccb2d4de14c4d85f9b97e | |
parent | 58544e2472953de4a61a58e7b4fec5a1dbe6d69a [diff] |
Support DoT query timeout The dnsresolver used to await the result from DnsTlsTransport without a specific timeout. This can cause lookup threads block on waiting the results for even few minutes. This CL adds a feature flag, dot_query_timeout_ms, to specify a timeout for sending a DNS query to DnsTlsTransport. If the flag is either unset or set to a negative value, the dnsresolver works as before. The test for DoT revalidation is written in this CL for convenience. Bug: 120182528 Test: set all the flags off and then run atest dot_query_timeout_ms: -1 dot_revalidation_threshold: -1 dot_async_handshake: 0 dot_xport_unusable_threshold: -1 dot_maxtries: 3 parallel_lookup_sleep_time: 2 dot_connect_timeout_ms: 127000 parallel_lookup_release: 0 sort_nameservers: 0 keep_listening_udp: 0 Test: set all the flags on and then run atest dot_query_timeout_ms: 10000 dot_revalidation_threshold: 10 dot_async_handshake: 1 dot_xport_unusable_threshold: 20 dot_maxtries: 1 parallel_lookup_sleep_time: 2 dot_connect_timeout_ms: 10000 parallel_lookup_release: 1 sort_nameservers: 1 keep_listening_udp: 1 Change-Id: If468e032bd01df5fdf44e8acf76d294ee4fdf312
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.