Skip to content

Commit 42ca528

Browse files
committed
Changed the declaration of the variable "shutdownCallback" as a volatile reference instead of AtomicReference
1 parent 552df7c commit 42ca528

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.spark.scheduler.cluster
1919

2020
import java.util.concurrent.Semaphore
21-
import java.util.concurrent.atomic.AtomicReference
2221

2322
import org.apache.spark.{Logging, SparkConf, SparkContext, SparkEnv}
2423
import org.apache.spark.deploy.{ApplicationDescription, Command}
@@ -36,8 +35,8 @@ private[spark] class SparkDeploySchedulerBackend(
3635

3736
private var client: AppClient = null
3837
private var stopping = false
39-
private var shutdownCallback: SparkDeploySchedulerBackend => Unit = _
40-
new AtomicReference
38+
39+
@volatile private var shutdownCallback: SparkDeploySchedulerBackend => Unit = _
4140
@volatile private var appId: String = _
4241

4342
private val registrationBarrier = new Semaphore(0)

0 commit comments

Comments
 (0)