racorn opened a new issue #8056:
URL: https://github.com/apache/pulsar/issues/8056


   I tried to set up proxy SNI routing with HAProxy - in a reverse proxy 
configuration, using the features added for PIP-60. The Pulsar cluster behind 
HAProxy had hostnames that were only resolvable locally in the datacenter where 
the HAProxy and Pulsar brokers were deployed.
   
   The client failed with an `UnknownHostExeception `that could be traced to 
the following lines in the `ConnectionPool `class:
   ```
           String hostname = unresolvedAddress.getHostString();
           int port = unresolvedAddress.getPort();
           try {
               // For non-sni-proxy: Resolve DNS --> Attempt to connect to all 
IP addresses until once succeeds
               CompletableFuture<List<InetAddress>> resolvedAddress = 
isSniProxy()
                       ? 
CompletableFuture.completedFuture(Lists.newArrayList(InetAddress.getByName(hostname)))
                       : resolveName(hostname);
               return resolvedAddress
                       .thenCompose(inetAddresses -> 
connectToResolvedAddresses(inetAddresses.iterator(), port));
   ```
   As the resolved hostname is only used as the value of the SNI header field, 
and not for the TCP-connection (the client connects to the host given in 
ProxyUrl), **I wonder if it should be required that the 'internal hosts' must 
be resolvable to the client**? (Also the `InetAddress.getByName` invocation 
seems to involve blocking IO).
   
   #### System configuration
   **Pulsar version**: 2.6.1
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to