X Tutup
Skip to content

core: Enable dns "caching" on Android#12681

Open
ejona86 wants to merge 1 commit intogrpc:masterfrom
ejona86:android-dns-cache
Open

core: Enable dns "caching" on Android#12681
ejona86 wants to merge 1 commit intogrpc:masterfrom
ejona86:android-dns-cache

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented Mar 9, 2026

DnsNameResolver discards refresh requests if it has been too soon after the last refresh, because the result is assumed to be identical to the previous fetch. Android itself will adhere to the RR's TTL, so requesting too frequently shouldn't have been causing too much I/O, but it could be causing extra CPU usage. Having some lower limit will reduce the number of useless address updates into the LB tree.

30 seconds is the same as regular Java and Go/C++ (which copied Java as a "reasonable" value). Note that other languages delay the refresh instead of discarding the refresh, but there's no reason why the existing discard behavior would cause much problem on Android vs normal Java. Chrome apparently uses 1 minute, so this really looks like it shouldn't cause problems as long as AndroidChannelBuilder is being used.

DnsNameResolver discards refresh requests if it has been too soon after
the last refresh, because the result is assumed to be identical to the
previous fetch. Android itself will adhere to the RR's TTL, so
requesting too frequently shouldn't have been causing too much I/O, but
it could be causing extra CPU usage. Having some lower limit will reduce
the number of useless address updates into the LB tree.

30 seconds is the same as regular Java and Go/C++ (which copied Java as
a "reasonable" value). Note that other languages _delay_ the refresh
instead of _discarding_ the refresh, but there's no reason why the
existing discard behavior would cause much problem on Android vs normal
Java. Chrome apparently uses 1 minute, so this really looks like it
shouldn't cause problems as long as AndroidChannelBuilder is being used.
@ejona86 ejona86 requested a review from kannanjgithub March 9, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup