Github user kayousterhout commented on a diff in the pull request:
https://github.com/apache/spark/pull/15326#discussion_r109323006
--- Diff: core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala ---
@@ -292,7 +290,100 @@ class PoolSuite extends SparkFunSuite with
LocalSparkContext {
}
}
- private def verifyPool(rootPool: Pool, poolName: String,
expectedInitMinShare: Int,
+ test("FIFO Scheduler should not add duplicate TaskSetManager") {
+ sc = new SparkContext(LOCAL, APP_NAME)
+ val taskScheduler = new TaskSchedulerImpl(sc)
+
+ val rootPool = new Pool("", SchedulingMode.FIFO, 0, 0)
+ val schedulableBuilder = new FIFOSchedulableBuilder(rootPool)
+
+ val taskSetManager0 = createTaskSetManager(0, 2, taskScheduler)
+ val taskSetManager1 = createTaskSetManager(1, 2, taskScheduler)
+ schedulableBuilder.addTaskSetManager(taskSetManager0, null)
+ schedulableBuilder.addTaskSetManager(taskSetManager0, null)
+ schedulableBuilder.addTaskSetManager(taskSetManager1, null)
+
+ assert(rootPool.schedulableQueue.size === 2)
+ assert(rootPool.schedulableNameToSchedulable.size === 2)
+
+ assert(rootPool.getSchedulableByName(taskSetManager0.name) ===
taskSetManager0)
+ assert(rootPool.getSchedulableByName(taskSetManager1.name) ===
taskSetManager1)
+ }
+
+ test("Fair Scheduler should not create duplicate pool") {
+ sc = createSparkContext("fairscheduler-duplicate-pools.xml")
+
+ val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0)
+ val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf)
+ schedulableBuilder.buildPools()
+
+ assert(rootPool.schedulableQueue.size === 2)
+ assert(rootPool.schedulableNameToSchedulable.size === 2)
+
+ verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1,
SchedulingMode.FIFO)
+ verifyPool(rootPool, "duplicate_pool1", 1, 1, SchedulingMode.FAIR)
+ }
+
+ test("Fair Scheduler should not add duplicate TaskSetManager via default
pool") {
+ sc = new SparkContext(LOCAL, APP_NAME)
+ val taskScheduler = new TaskSchedulerImpl(sc)
+
+ val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0)
+ val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf)
+ schedulableBuilder.buildPools()
+
+ val taskSetManager0 = createTaskSetManager(0, 2, taskScheduler)
+ val taskSetManager1 = createTaskSetManager(1, 2, taskScheduler)
+ schedulableBuilder.addTaskSetManager(taskSetManager0, null)
+ schedulableBuilder.addTaskSetManager(taskSetManager0, null)
--- End diff --
similar to the above -- when could this happen?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]