Bug 1054776 - ClientConfigurationImpl should not translate IP address to host name
Summary: ClientConfigurationImpl should not translate IP address to host name
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management
Version: 6.2.0,6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: DR0
: EAP 6.3.0
Assignee: Jan Martiska
QA Contact: Petr Kremensky
Russell Dickenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-17 12:59 UTC by Jan Martiska
Modified: 2014-08-20 10:21 UTC (History)
4 users (show)

(edit)
In previous releases of JBoss EAP, when creating an instance of a controller client and passing it an IP address to connect to, the IP address was internally translated to the machine's host name.

Then, when the client attempted to make a connection, it used the host name rather than the IP address. 

This not only introduced unnecessary overhead by involving the DNS server, but in some very specific deployment scenarios, it caused the client to try to connect to a different IP address of the same machine than the one where a JBoss EAP instance was bound, resulting in a failure of this connection attempt. 

This has been fixed in this release; the controller client code does not internally translate the given IP address to the host name and uses only the IP address (rather than the corresponding host name) for making a connection. 

Note that this fix does not affect the scenario when a host name is passed to the controller client's factory method. In this case, the host name will be translated to an IP address and that address will be used, as expected.
Clone Of:
(edit)
Last Closed: 2014-06-28 15:25:15 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2773 Major Resolved ClientConfigurationImpl should not translate IP address to host name 2014-08-21 10:44:06 UTC
Red Hat Bugzilla 1043768 None None None Never

Internal Trackers: 1043768

Description Jan Martiska 2014-01-17 12:59:44 UTC
When creating a ModelControllerClient and passing in an IP address, ClientConfigurationImpl internally translates it to a host name, like here:

public static ModelControllerClientConfiguration create(final InetAddress address, final int port) {
        return new ClientConfigurationImpl(address.getHostName(), port, null, null, null, createDefaultExecutor(), true, null);
    }

Later on, when the client connects, it is translated via DNS back to an IP address. This is not only unnecessary, but in some situations, it is wrong.

Consider a Windows machine having two IP addresses ,A and B, on one network interface, where only A is pointed at by a DNS record.

    Run AS testsuite and pass it the address B as the node0 property, AS will bind itself to this address.
    Now when a test creates a ModelControllerClient using IP address B, the address B will get translated to the host name, even though B is not in the DNS. The resolving works this way on a Windows machine.
    During the connection, the host name will get resolved by DNS to address A and the test will try to connect through address A. The connection will be refused, or worse, might connect to another instance on the same machine.

Comment 1 Kabir Khan 2014-01-21 17:52:53 UTC
https://github.com/jbossas/jboss-eap/pull/835

Comment 2 Petr Kremensky 2014-03-04 09:50:32 UTC
Verified on EAP 6.3.0.DR1


Note You need to log in before you can comment on or make changes to this bug.