Skip to content

Commit e901eb2

Browse files
committed
fix local-cluster mode for ExternalShuffleServiceSuite
1 parent 59e5e38 commit e901eb2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core/src/main/scala/org/apache/spark/deploy/ExternalShuffleService.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ private[deploy]
4040
class ExternalShuffleService(sparkConf: SparkConf, securityManager: SecurityManager)
4141
extends Logging {
4242

43-
private val enabled = sparkConf.getBoolean("spark.shuffle.service.enabled", false)
43+
// Check both if shuffle service is enabled, and that the worker should actually host the
44+
// shuffle service in that case. (The latter is currently only used for testing.)
45+
private val enabled = sparkConf.getBoolean("spark.shuffle.service.enabled", false) &&
46+
sparkConf.getBoolean("spark.worker.shouldHostShuffleServiceIfEnabled", true)
4447
private val port = sparkConf.getInt("spark.shuffle.service.port", 7337)
4548
private val useSasl: Boolean = securityManager.isAuthenticationEnabled()
4649

core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class ExternalShuffleServiceSuite extends ShuffleSuite with BeforeAndAfterAll {
4343
conf.set("spark.shuffle.manager", "sort")
4444
conf.set("spark.shuffle.service.enabled", "true")
4545
conf.set("spark.shuffle.service.port", server.getPort.toString)
46+
47+
// local-cluster mode starts a Worker which would start its own shuffle service without this:
48+
conf.set("spark.worker.shouldHostShuffleServiceIfEnabled", "false")
4649
}
4750

4851
override def afterAll() {

0 commit comments

Comments
 (0)