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
Fixes hostname retrieval triggering possible DNS lookups for Thrift plugin #4427
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4427 +/- ##
==========================================
+ Coverage 40.78% 40.83% +0.04%
==========================================
Files 2487 2488 +1
Lines 75672 75687 +15
Branches 10243 10238 -5
==========================================
+ Hits 30863 30904 +41
+ Misses 41975 41952 -23
+ Partials 2834 2831 -3
Continue to review full report at Codecov.
|
39d72bf
to
e859672
Compare
private static HostStringAccessor createHostStringAccessor() { | ||
try { | ||
final Method m = InetSocketAddress.class.getDeclaredMethod("getHostString"); | ||
m.setAccessible(true); |
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.
getHostString() in jdk6 is a package level accessor.
So all versions of jdk1.6 should be checked that method is included.
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.
@koo-taejin Thanks for the reminder.
getHostString()
is present in 1.6.0_0 and in 1.6.0_45, so it should be there for other versions of 1.6 as well.
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 👍
This solves the issue where the Thrift plugin would attempt a reverse DNS lookup when retrieving the host name if a TSocket was created using an address.
Utility methods are also added, which given an InetSocketAddress, would retrieve the host name or the address without triggering forward/reverse DNS lookup.
resolves #4389