This is an automated email from the ASF dual-hosted git repository.

mridulm80 pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new f73e6ca  [SPARK-32663][CORE] Avoid individual closing of pooled 
TransportClients (which must be closed through the pool)
f73e6ca is described below

commit f73e6caa2392a2aa456ec5951fbf15cb514af3ef
Author: “attilapiros” <[email protected]>
AuthorDate: Fri Aug 21 01:02:33 2020 -0500

    [SPARK-32663][CORE] Avoid individual closing of pooled TransportClients 
(which must be closed through the pool)
    
    ### What changes were proposed in this pull request?
    
    Removing the individual `close` method calls on the pooled 
`TransportClient` instances.
    The pooled clients should be only closed via 
`TransportClientFactory#close()`.
    
    ### Why are the changes needed?
    
    Reusing a closed `TransportClient` leads to the exception 
`java.nio.channels.ClosedChannelException`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    This is a trivial case which is not tested by specific test.
    
    Closes #29492 from attilapiros/SPARK-32663.
    
    Authored-by: “attilapiros” <[email protected]>
    Signed-off-by: Mridul Muralidharan <mridul<at>gmail.com>
    (cherry picked from commit 79b4dea1b08adc9d4b545a1af29ac50fa603936a)
    Signed-off-by: Mridul Muralidharan <mridulatgmail.com>
---
 .../org/apache/spark/network/shuffle/ExternalBlockStoreClient.java  | 6 ------
 1 file changed, 6 deletions(-)

diff --git 
a/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockStoreClient.java
 
b/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockStoreClient.java
index d6185f0..98247f2 100644
--- 
a/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockStoreClient.java
+++ 
b/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalBlockStoreClient.java
@@ -175,8 +175,6 @@ public class ExternalBlockStoreClient extends 
BlockStoreClient {
           logger.warn("Error trying to remove RDD blocks " + 
Arrays.toString(blockIds) +
             " via external shuffle service from executor: " + execId, t);
           numRemovedBlocksFuture.complete(0);
-        } finally {
-          client.close();
         }
       }
 
@@ -185,7 +183,6 @@ public class ExternalBlockStoreClient extends 
BlockStoreClient {
         logger.warn("Error trying to remove RDD blocks " + 
Arrays.toString(blockIds) +
           " via external shuffle service from executor: " + execId, e);
         numRemovedBlocksFuture.complete(0);
-        client.close();
       }
     });
     return numRemovedBlocksFuture;
@@ -212,8 +209,6 @@ public class ExternalBlockStoreClient extends 
BlockStoreClient {
               Arrays.toString(getLocalDirsMessage.execIds) + " via external 
shuffle service",
               t.getCause());
             hostLocalDirsCompletable.completeExceptionally(t);
-          } finally {
-            client.close();
           }
         }
 
@@ -223,7 +218,6 @@ public class ExternalBlockStoreClient extends 
BlockStoreClient {
             Arrays.toString(getLocalDirsMessage.execIds) + " via external 
shuffle service",
             t.getCause());
           hostLocalDirsCompletable.completeExceptionally(t);
-          client.close();
         }
       });
     } catch (IOException | InterruptedException e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to