Commit 0675f70
committed
core: Enable dns "caching" on Android
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.1 parent 4de4718 commit 0675f70
File tree
2 files changed
+23
-32
lines changed- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
2 files changed
+23
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
| |||
Lines changed: 17 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 154 | | |
162 | 155 | | |
163 | 156 | | |
| |||
227 | 220 | | |
228 | 221 | | |
229 | 222 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | 223 | | |
243 | 224 | | |
244 | 225 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 226 | | |
250 | 227 | | |
251 | 228 | | |
252 | 229 | | |
253 | | - | |
| 230 | + | |
254 | 231 | | |
255 | 232 | | |
256 | 233 | | |
| |||
443 | 420 | | |
444 | 421 | | |
445 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
446 | 435 | | |
447 | 436 | | |
448 | 437 | | |
449 | | - | |
| 438 | + | |
450 | 439 | | |
451 | 440 | | |
452 | 441 | | |
453 | 442 | | |
454 | 443 | | |
455 | | - | |
| 444 | + | |
456 | 445 | | |
457 | 446 | | |
458 | | - | |
| 447 | + | |
459 | 448 | | |
460 | 449 | | |
461 | 450 | | |
462 | 451 | | |
463 | 452 | | |
464 | 453 | | |
465 | | - | |
| 454 | + | |
466 | 455 | | |
467 | 456 | | |
468 | 457 | | |
| |||
0 commit comments