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

    https://github.com/apache/spark/pull/12315#discussion_r59409060
  
    --- Diff: 
common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java
 ---
    @@ -149,25 +148,31 @@ 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;
    +    logger.trace("Spent {} ms to resolve {}", hostResolveTimeMs, 
resolvedAddress);
    --- End diff --
    
    I think it's more useful to log a warning if this time is greater than say 
2 seconds.


---
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