SteNicholas commented on code in PR #2120:
URL: 
https://github.com/apache/incubator-celeborn/pull/2120#discussion_r1407727400


##########
common/src/main/java/org/apache/celeborn/common/network/client/TransportClientFactory.java:
##########
@@ -250,8 +258,29 @@ public void initChannel(SocketChannel ch) {
     }
 
     TransportClient client = clientRef.get();
+    Channel channel = channelRef.get();
     assert client != null : "Channel future completed successfully with null 
client";
 
+    // Execute any client bootstraps synchronously before marking the Client 
as successful.
+    long preBootstrap = System.nanoTime();
+    logger.debug("Connection to {} successful, running bootstraps...", 
address);
+    try {
+      for (TransportClientBootstrap clientBootstrap : clientBootstraps) {
+        clientBootstrap.doBootstrap(client, channel);
+      }
+    } catch (Exception e) { // catch non-RuntimeExceptions too as bootstrap 
may be written in Scala
+      long bootstrapTimeMs = Duration.ofNanos(System.nanoTime() - 
preBootstrap).toMillis();
+      logger.error("Exception while bootstrapping client after " + 
bootstrapTimeMs + " ms", e);

Review Comment:
   ```suggestion
         logger.error("Exception while bootstrapping client after " + 
Utils.msDurationToString(bootstrapTimeMs), e);
   ```



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to