Skip to content

Commit 7f37188

Browse files
sarutaktgravescs
authored andcommitted
[SPARK-4282][YARN] Stopping flag in YarnClientSchedulerBackend should be volatile
In YarnClientSchedulerBackend, a variable "stopping" is used as a flag and it's accessed by some threads so it should be volatile. Author: Kousuke Saruta <[email protected]> Closes #3143 from sarutak/stopping-flag-volatile and squashes the following commits: 58fdcc9 [Kousuke Saruta] Marked stoppig flag as volatile
1 parent f820b56 commit 7f37188

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private[spark] class YarnClientSchedulerBackend(
3333

3434
private var client: Client = null
3535
private var appId: ApplicationId = null
36-
private var stopping: Boolean = false
36+
@volatile private var stopping: Boolean = false
3737

3838
/**
3939
* Create a Yarn client to submit an application to the ResourceManager.

0 commit comments

Comments
 (0)