-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolver/dns: Add SetMinResolutionInterval Option #6962
resolver/dns: Add SetMinResolutionInterval Option #6962
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6962 +/- ##
==========================================
- Coverage 81.28% 81.19% -0.10%
==========================================
Files 345 345
Lines 33925 33927 +2
==========================================
- Hits 27577 27546 -31
- Misses 5184 5208 +24
- Partials 1164 1173 +9
|
1a0eb21
to
ffde661
Compare
@dfawley I would really appreciate it if you would take a look at this merge request. |
I'm not able to add any labels or milestones. Would you please help me around? |
Hi, I think a change like this is OK but we'd want it to be a global configuration knob like we are doing with DNS resolution timeouts in #6917. Please let us know if you have any questions about that approach. |
This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
ffde661
to
32b53fd
Compare
Hello again, sorry for the later reply. I've changed the structure to the best of my knowledge according to the pull request you've mentioned. Please let me know if there's any problem. @dfawley |
Hi again, is there anything I can do further for this PR or is there still anything wrong with it? Thanks a lot @dfawley |
32b53fd
to
4e95397
Compare
I resolved the conflicts and it's ready to go! Let me know if I need to change anything. |
Sorry for the delay.. I will review it this week for sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few minor comments. Thank you for the PR!
resolver/dns/dns_resolver.go
Outdated
// | ||
// Using this option overwrites the default [MinResolutionRate] specified | ||
// in the internal dns resolver package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an implementation detail and should be kept out of godoc comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Done.
origMinResRate := dns.MinResolutionRate | ||
dns.MinResolutionRate = d | ||
t.Cleanup(func() { dns.MinResolutionRate = origMinResRate }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this call into the exported DNS library's SetMinResolution...
instead, to get test coverage of the setter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, thanks for pointing it out! Done.
4a02e12
to
2398289
Compare
I struggle to understand why the |
This check is optional, and the failure is caused by an upstream protobuf definition change. Please ignore it. |
Thanks a lot. I think all the comments are resolved. Let me know if I need to change anything. |
resolver/dns/dns_resolver.go
Outdated
// SetMinResolutionRate sets the default minimum rate at which DNS re-resolutions are | ||
// allowed. This helps to prevent excessive re-resolution. | ||
func SetMinResolutionRate(d time.Duration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear I wrote this comment in the last pass, but it's gone now. :) Sorry!
Please rename this to SetMinResolutionInterval
(and change the global variable name to match). A "rate" is the opposite of what this is. (This actually determines the maximum rate, or the minimum interval.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're totally right, thanks for pointing it out!
I think I managed to change all of them. I triple checked to make sure but let me know if there's still anything wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for the PR @HomayoonAlimohammadi.
Slightly updated the PR title/description to match the latest diff.
In this merge request I tried to make
SetMinResolutionInterval
which is currently a constant duration variable by providing options. SetMinResolutionInterval sets the default minimum interval at which DNS re-resolutions are allowed. This helps to prevent excessive re-resolution.RELEASE NOTES:
SetMinResolutionInterval
to set the minimum interval at which DNS re-resolutions may occur.