[ 
https://issues.apache.org/jira/browse/HDFS-3990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508889#comment-13508889
 ] 

Chris Nauroth commented on HDFS-3990:
-------------------------------------

The problem I observe is that a server accepts a client socket connection, gets 
the connection's InetAddress, and then getHostName returns "127.0.0.1".  Below 
is a short code sample that demonstrates the problem.  This is a very rough 
approximation of the IPC Server/Connection and DatanodeManager logic.  When I 
run this server on Mac, it prints "connection from hostName = localhost, 
hostAddress = 127.0.0.1, canonicalHostName = localhost" for any client 
connection.  On Windows, it prints "connection from hostName = 127.0.0.1, 
hostAddress = 127.0.0.1, canonicalHostName = 127.0.0.1".

{code}
package cnauroth;

import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.channels.ServerSocketChannel;

class Main {
  public static void main(String[] args) throws Exception {
    ServerSocket ss = ServerSocketChannel.open().socket();
    ss.bind(new InetSocketAddress("localhost", 1234), 0);
    System.out.println("ss = " + ss);
    for (;;) {
      Socket s = ss.accept();
      InetAddress addr = s.getInetAddress();
      System.out.println("connection from hostName = " + addr.getHostName() + 
", hostAddress = " + addr.getHostAddress() + ", canonicalHostName = " + 
addr.getCanonicalHostName());
      PrintWriter pw = new PrintWriter(s.getOutputStream());
      pw.println("hello");
      pw.close();
      s.close();
    }
  }
}
{code}

                
> NN's health report has severe performance problems
> --------------------------------------------------
>
>                 Key: HDFS-3990
>                 URL: https://issues.apache.org/jira/browse/HDFS-3990
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 0.23.0, 2.0.0-alpha, 3.0.0
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>            Priority: Critical
>             Fix For: 3.0.0, 2.0.3-alpha, 0.23.5
>
>         Attachments: HDFS-3990.branch-0.23.patch, 
> HDFS-3990.branch-0.23.patch, HDFS-3990.patch, HDFS-3990.patch, 
> HDFS-3990.patch, HDFS-3990.patch, HDFS-3990.patch, HDFS-3990.patch, 
> HDFS-3990.patch, HDFS-3990.patch, hdfs-3990.txt, hdfs-3990.txt
>
>
> The dfshealth page will place a read lock on the namespace while it does a 
> dns lookup for every DN.  On a multi-thousand node cluster, this often 
> results in 10s+ load time for the health page.  10 concurrent requests were 
> found to cause 7m+ load times during which time write operations blocked.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to