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 74e983c2a7..071810ad29 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 @@ -167,8 +167,9 @@ public void stop() { if (lifecycleManager != null) { lifecycleManager.stop(); } - if (sortShuffleManager() != null) { - sortShuffleManager().stop(); + if (_sortShuffleManager != null) { + _sortShuffleManager.stop(); + _sortShuffleManager = null; } } 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 c0d3bd2864..aa1c1a2c25 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 @@ -197,8 +197,8 @@ public void stop() { lifecycleManager.stop(); lifecycleManager = null; } - if (sortShuffleManager() != null) { - sortShuffleManager().stop(); + if (_sortShuffleManager != null) { + _sortShuffleManager.stop(); _sortShuffleManager = null; } }