sunchao commented on code in PR #3746:
URL: https://github.com/apache/celeborn/pull/3746#discussion_r3540634854


##########
common/src/main/java/org/apache/celeborn/common/network/client/TransportClientFactory.java:
##########
@@ -315,14 +328,19 @@ public void initChannel(SocketChannel ch) {
     long preConnect = System.nanoTime();
     ChannelFuture cf = bootstrap.connect(address);
     if (connectTimeoutMs <= 0) {
-      cf.await();
+      awaitWithChannelCleanup(
+          () -> {
+            cf.await();
+            return true;
+          },
+          cf);
       assert cf.isDone();
       if (cf.isCancelled()) {

Review Comment:
   Done in `311bc8c1c`. The `connectTimeoutMs <= 0` branch now calls 
`closeChannel(cf)` before both the cancelled-future and failed-future throws. 
The normal Netty listener still provides the usual failure cleanup, while these 
explicit closes make this synchronous branch defensive and consistent with the 
timeout and interruption paths.



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