ndimiduk commented on code in PR #4693:
URL: https://github.com/apache/hadoop/pull/4693#discussion_r945854695


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/DNSDomainNameResolver.java:
##########
@@ -40,6 +48,16 @@ public String getHostnameByIP(InetAddress address) {
         && host.charAt(host.length()-1) == '.') {
       host = host.substring(0, host.length()-1);
     }
+    // Protect against the Java behaviour of returning the IP address as a 
string from a cache
+    // instead of performing a reverse lookup.
+    if (host.equals(address.getHostAddress())) {

Review Comment:
   In fact, it should never be null according to the docs on 
`getCanonicalHostName`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to