-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Choose addr cached based on a round robin strategy #1836
Conversation
At each attempt to open a new connection, the addrs related to that specific host will be retrieved using a round robin strategy. As a result all hosts resolved by the DNS query will be used.
Codecov Report
@@ Coverage Diff @@
## master #1836 +/- ##
==========================================
+ Coverage 97.23% 97.24% +<.01%
==========================================
Files 37 37
Lines 7499 7523 +24
Branches 1301 1303 +2
==========================================
+ Hits 7292 7316 +24
Misses 87 87
Partials 120 120
Continue to review full report at Codecov.
|
any feedback about this @fafhrd91 ? |
lgtm. @kxepal any comments? |
@asvetlov comments? |
Looks good since it's totaly private thing, but I wonder if we need to have something like this rather than suggest to install some local dns cache service instead, like dnsmasq, systemd or whatever. Windows has it own OS local DSN cache. Double caching problem may be not good. |
I can tell you a story about Hadoop namenode which uses sort of local dns cache as well and how this turns things into hell when you need to migrate some nodes to another zone. |
Looks good. @pfreixes would you fix it? |
@pfreixes thanks! |
Hi, first thanks for the reviewing to all of you @fafhrd91 @asvetlov and @kxepal Regarding the constructor param in the @kxepal The idea behind this it's put some continuation in this other work [1], having an expiration of the DNS table with an enough low value and having the chance to use all There are examples that show you how the software [2] spent some time to react to the change in the expiration latency, IMHO the app layer has to be ready to live in an environment where the resolutions can change quickly. [1] #1819 |
@pfreixes |
At each attempt to open a new connection, the addrs related to that
specific host will be retrieved using a round robin strategy. As a
result all hosts resolved by the DNS query will be used.
What do these changes do?
Enable the use of all addresses resolved for a specific host name. The current implementation only falls to the next host if and only if the first one fails. Taking into account that DNS entries returned do not have weights all addresses must be eligibles.
Are there changes in behavior for the user?
No
Related issue number
Checklist
CONTRIBUTORS.txt
CHANGES.rst
#issue_number
format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.