Github user tedyu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12315#discussion_r59519389
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java
 ---
    @@ -149,25 +148,35 @@ public TransportClient createClient(String 
remoteHost, int remotePort) throws IO
           }
     
           if (cachedClient.isActive()) {
    -        logger.trace("Returning cached connection to {}: {}", address, 
cachedClient);
    +        logger.trace("Returning cached connection to {}: {}",
    +          cachedClient.getSocketAddress(), cachedClient);
             return cachedClient;
           }
         }
     
         // If we reach here, we don't have an existing connection open. Let's 
create a new one.
         // Multiple threads might race here to create new connections. Keep 
only one of them active.
    +    final long preResolveHost = System.nanoTime();
    +    final InetSocketAddress resolvedAddress = new 
InetSocketAddress(remoteHost, remotePort);
    +    final long hostResolveTimeMs = (System.nanoTime() - preResolveHost) / 
1000000;
    +    if (hostResolveTimeMs > 2000) {
    --- End diff --
    
    Should the value of 2000 be configurable ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to