-
Notifications
You must be signed in to change notification settings - Fork 478
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
fix issue #480 : UDP target host address is cached #499
Conversation
Hi @lxhoan Writing 100 lines of code of a already existing feature is waste of time. |
Hi All, Once we have parsed and cached the host IP address, as in
then hostAddress stayed unchanged and UDP writing will fail if the target host IP gets changed. networkaddress.cache.ttl will not help this case @fmachado, apropos of PR #481, in discussion with PR author I suggest that we can use a socket adress as follows
that means we accept to resolve DNS each UDP writing. This approach is not a good idea if the JVM is not configured with a appropriate networkaddress.cache.ttl or no security manager is installed for the JVM. So I would like to introduce this PR |
In my opinion the issue #480 (UDP target host address is cached) is valid and we should address it somehow |
Hi @lxhoan
|
this scenario (what mentioned in issue #480)
2/ at a certain time, host abc.com changes to a new IP address |
I may be wrong but I think if the With the scenario I mentioned here, if you set |
What if we do not resolv in parseAddress() ? |
I originally in PR #481 suggested to resolve on UDP writing, as follow
you can see InetSocketAddress constructor will resolve hostname to the IP address. but this way can overwork the DNS server or make the DNS server think you are trying a DOS attack on it. Then I think to resolve it periodically 5min (as the default eviction time of OKHttp Connection pool) However, how about introducing one more parameter to InfluxDBImpl so user can configure this resolving period ? |
Yes, so how about introducing one more parameter to InfluxDBImpl so user can configure this resolving period ? (setting networkaddress.cache.ttl cannot refresh the hostAddress to new IP adress) |
?!? But this is exactly what this option is offering. After n seconds, records are considered expired and the next time a hostname needs to be resolved, JVM will perform a DNS lookup. @lxhoan you mentioned If the JVM allows the user to solve his problem and the user didn't configure properly the JVM, why we are supposed to do it? So, again:
Anyway, I vote for do not merge this PR. |
@fmachado , I think we are misunderstanding
But we have already resolved it in the InfluxDBImpl constructor : InfluxDBImple, line 119
So how can this.hostAddress get updated in case the host changes to new IP Address ? |
Hi All, does my last comment make some sense ? |
closed (PR #502 as the alternative) |
This PR is to resolve host address for UDP writing, period is 5 mins
(follow the default eviction period of OKHttp conection pool)