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

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 5c7848d53 [CELEBORN-804][FOLLOWUP] ShuffleManager stop should set 
shuffleClient to null
5c7848d53 is described below

commit 5c7848d531de668eabcebde550f2c1c35695d329
Author: Angerszhuuuu <[email protected]>
AuthorDate: Thu Jul 20 20:35:23 2023 +0800

    [CELEBORN-804][FOLLOWUP] ShuffleManager stop should set shuffleClient to 
null
    
    ### What changes were proposed in this pull request?
    As title
    
    ### Why are the changes needed?
    
    ### Does this PR introduce _any_ user-facing change?
    
    ### How was this patch tested?
    
    Closes #1737 from AngersZhuuuu/CELEBORN-804-FOLLOWUP.
    
    Authored-by: Angerszhuuuu <[email protected]>
    Signed-off-by: zky.zhoukeyong <[email protected]>
---
 .../java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java | 6 +++++-
 .../java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java | 6 +++++-
 client/src/main/java/org/apache/celeborn/client/ShuffleClient.java  | 3 ---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
 
b/client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
index 477b3f505..74e983c2a 100644
--- 
a/client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
+++ 
b/client-spark/spark-2/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
@@ -159,7 +159,11 @@ public class SparkShuffleManager implements ShuffleManager 
{
 
   @Override
   public void stop() {
-    ShuffleClient.reset();
+    if (shuffleClient != null) {
+      shuffleClient.shutdown();
+      ShuffleClient.reset();
+      shuffleClient = null;
+    }
     if (lifecycleManager != null) {
       lifecycleManager.stop();
     }
diff --git 
a/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
 
b/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
index 63cab05e9..85ccea491 100644
--- 
a/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
+++ 
b/client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SparkShuffleManager.java
@@ -167,7 +167,11 @@ public class SparkShuffleManager implements ShuffleManager 
{
 
   @Override
   public void stop() {
-    ShuffleClient.reset();
+    if (shuffleClient != null) {
+      shuffleClient.shutdown();
+      ShuffleClient.reset();
+      shuffleClient = null;
+    }
     if (lifecycleManager != null) {
       lifecycleManager.stop();
       lifecycleManager = null;
diff --git a/client/src/main/java/org/apache/celeborn/client/ShuffleClient.java 
b/client/src/main/java/org/apache/celeborn/client/ShuffleClient.java
index e1e0c1468..fad9a6957 100644
--- a/client/src/main/java/org/apache/celeborn/client/ShuffleClient.java
+++ b/client/src/main/java/org/apache/celeborn/client/ShuffleClient.java
@@ -44,9 +44,6 @@ public abstract class ShuffleClient {
 
   // for testing
   public static void reset() {
-    if (_instance != null) {
-      _instance.shutdown();
-    }
     _instance = null;
     initialized = false;
     hdfsFs = null;

Reply via email to