Bug 1054776

Summary: ClientConfigurationImpl should not translate IP address to host name
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jan Martiska <jmartisk>
Component: Domain ManagementAssignee: Jan Martiska <jmartisk>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: high Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0, 6.1.1CC: emuckenh, kkhan, pjelinek, smumford
Target Milestone: DR0   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:25:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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