[jboss-jira] [JBoss JIRA] Created: (JBCACHE-817) Remove all calls to InetAddress.getHostName() (causes reverse DNS lookup)

Michael Newcomb (JIRA) jira-events at jboss.com
Fri Oct 27 09:52:41 EDT 2006


Remove all calls to InetAddress.getHostName() (causes reverse DNS lookup)
-------------------------------------------------------------------------

                 Key: JBCACHE-817
                 URL: http://jira.jboss.com/jira/browse/JBCACHE-817
             Project: JBoss Cache
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Clustering
         Environment: JBoss 4.0.4
            Reporter: Michael Newcomb
         Assigned To: Manik Surtani
            Priority: Minor


Any call to InetAddress.getHostName() will cause a reverse DNS lookup. If DNS is not configured, can cause slow startup/join times between JBoss clusters.

The most notable is in ClusterNode.java:

public ClusterNode(IpAddress jgAddress)
{
   if (jgAddress.getAdditionalData() == null)
   {
      this.id = jgAddress.getIpAddress().getHostAddress() + ":" + jgAddress.getPort();
   }
   else
   {
      this.id = new String(jgAddress.getAdditionalData());
   }
   this.originalJGAddress = jgAddress;
   StringBuffer sb = new StringBuffer();
   java.net.InetAddress jgIPAddr = jgAddress.getIpAddress();
   if (jgIPAddr == null)
      sb.append("<null>");
   else
   {
      if (jgIPAddr.isMulticastAddress())
         sb.append(jgIPAddr.getHostAddress());
      else
----->>>>      sb.append(getShortName(jgIPAddr.getHostName()));
   }
   sb.append(":" + jgAddress.getPort());
   this.jgId = sb.toString();
}

The following:
if (jgIPAddr.isMulticastAddress())
   sb.append(jgIPAddr.getHostAddress());
else
   sb.append(getShortName(jgIPAddr.getHostName()));

should be replaced with:
sb.append(jgIPAddr.getHostAddress());

I am currently trying to configure our machine for reverse DNS lookup to see if that at least solves the slow lookup problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list