Skip to content

Commit

Permalink
dfp: Disable DNS refresh on failure (#38215)
Browse files Browse the repository at this point in the history
Commit Message: Adds a feature to disable DNS refresh on failure by
setting `DnsCache.disable_dns_refresh_on_failure` to true. By enabling
this feature, failed hosts will be treated as a cache miss.
Additional Description: In a mobile environment where the network
connectivity can change a lot, such as airplane mode, offline to online,
switching from cellular to WiFi, etc., using the DNS cache for the
failed hosts means the requests to those hosts will automatically fail
until the next DNS cache refresh. Having an automatic DNS refresh on
failures unnecessarily (such as when the device is offline) can also
waste the battery life.
Risk Level: low (a  new feature)
Testing: unit and integration tests
Docs Changes: inline
Release Notes: inline
Platform Specific Features: dfp

---------

Signed-off-by: Fredy Wijaya <fredyw@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ c0a1be5b5604bc963254a9f5f76bec6ed23d6a40
  • Loading branch information
update-envoy[bot] committed Jan 28, 2025
1 parent 4de3c74 commit 5105254
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ message DnsCacheCircuitBreakers {

// Configuration for the dynamic forward proxy DNS cache. See the :ref:`architecture overview
// <arch_overview_http_dynamic_forward_proxy>` for more information.
// [#next-free-field: 15]
// [#next-free-field: 16]
message DnsCacheConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.common.dynamic_forward_proxy.v2alpha.DnsCacheConfig";
Expand Down Expand Up @@ -94,6 +94,12 @@ message DnsCacheConfig {
// value depending on timing. This is similar to how other circuit breakers work.
google.protobuf.UInt32Value max_hosts = 5 [(validate.rules).uint32 = {gt: 0}];

// Disable the DNS refresh on failure. If this field is set to true, it will ignore the
// :ref:`typed_dns_resolver_config <envoy_v3_api_field_extensions.common.dynamic_forward_proxy.v3.DnsCacheConfig.dns_failure_refresh_rate>`.
// If not specified, it defaults to false. By enabling this feature, the failed hosts will now be treated as a cache miss,
// allowing the failed hosts to be resolved on demand.
bool disable_dns_refresh_on_failure = 15;

// If the DNS failure refresh rate is specified,
// this is used as the cache's DNS refresh rate when DNS requests are failing. If this setting is
// not specified, the failure refresh rate defaults to the dns_refresh_rate.
Expand Down

0 comments on commit 5105254

Please sign in to comment.