resolver/dns: add RefreshInterval parameter to enable periodic DNS record refresh #8230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the DNS resolver by adding a
RefreshInterval
variable, which defines the rate at which the resolver refreshes its DNS records. The default value is set to0
, disabling the refresh unless configured otherwise.Key changes include:
RefreshInterval
Variable: Allows for periodic DNS record refreshes, with a requirement that the value must be at leastMinResolutionInterval
.watcher
Function: Incorporates a new channel (refreshCh
) to handle refresh signals, enabling automatic updates of DNS records alongside resolution requests.SetRefreshInterval
function is added to allow users to configure the refresh interval while ensuring it meets the minimum requirement.These enhancements improve the DNS resolver's responsiveness and accuracy in dynamic environments. Notably, similar functionality is available in the gRPC implementation for ASP.NET Core, which also features DNS address caching and refresh mechanisms (see ASP.NET Core gRPC Load Balancing Documentation). This alignment with existing practices enhances consistency across platforms.
RELEASE NOTES: