From 6bb1f609e8aed9b8ac1d52721d641fa1cba2a168 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Wed, 15 Jan 2025 12:05:40 +0800 Subject: [PATCH] fix StorageUtils.externalShuffleServicePort --- .../main/scala/org/apache/spark/storage/StorageUtils.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/storage/StorageUtils.scala b/core/src/main/scala/org/apache/spark/storage/StorageUtils.scala index 022dbbf59d7cf..28b619aa1c509 100644 --- a/core/src/main/scala/org/apache/spark/storage/StorageUtils.scala +++ b/core/src/main/scala/org/apache/spark/storage/StorageUtils.scala @@ -224,9 +224,9 @@ private[spark] object StorageUtils extends Logging { * set through the Hadoop configuration as the server is launched in the Yarn NM. */ def externalShuffleServicePort(conf: SparkConf): Int = { - if (Utils.isLocalSparkCluster(conf)) { - assert(sys.env.contains(ExternalShuffleService.TESTING_ESS_PORT_ENV), - s"${ExternalShuffleService.TESTING_ESS_PORT_ENV} is not available") + if (sys.env.contains(ExternalShuffleService.TESTING_ESS_PORT_ENV)) { + assert(Utils.isLocalSparkCluster(conf), s"${ExternalShuffleService.TESTING_ESS_PORT_ENV} " + + s"should only be set in local Spark cluster") val port = sys.env(ExternalShuffleService.TESTING_ESS_PORT_ENV).toInt if (conf.contains(config.SHUFFLE_SERVICE_PORT.key)) { logWarning(log"Setting external shuffle service port in Spark local cluster " +