Project: mule
Issue MULE-7194: Improper handling of UnknownHostException in Outbound TCP
The problem is that when a hostname cannot be resolved (bad hostname is provided, or DNS is down, etc), Mule's connection pooling system will interpret it as localhost. In the case where the local host happens to be listening on the same port, it can result in messages being routed to the wrong place, whereas they should have failed to connect due to the bad hostname. This is caused by: 1. In the constructor of org.mule.transport.tcp.TcpSocketKey, an InetSocketAddress is constructed. If host resolution fails, the object is created anyway. 2. In org.mule.transport.tcp.TcpSocketFactory, 'getAddress()' is called on the socket key and passed directly into socket.connect(...). 3. In the case that step (1) failed, 'getAddress()' will return null. socket.connect(...) interprets null to be localhost.
Story points: 1