Skip to content

Commit

Permalink
[SPARK-6059][Yarn] Add volatile to ApplicationMaster's reporterThread…
Browse files Browse the repository at this point in the history
… and allocator

`ApplicationMaster.reporterThread` and `ApplicationMaster.allocator` are accessed in multiple threads, so they should be marked as `volatile`.

Author: zsxwing <[email protected]>

Closes apache#4814 from zsxwing/SPARK-6059 and squashes the following commits:

17d9386 [zsxwing] Add volatile to ApplicationMaster's reporterThread and allocator
  • Loading branch information
zsxwing authored and srowen committed Feb 27, 2015
1 parent e747e98 commit 57566d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ private[spark] class ApplicationMaster(
@volatile private var finalMsg: String = ""
@volatile private var userClassThread: Thread = _

private var reporterThread: Thread = _
private var allocator: YarnAllocator = _
@volatile private var reporterThread: Thread = _
@volatile private var allocator: YarnAllocator = _

// Fields used in client mode.
private var actorSystem: ActorSystem = null
Expand Down

0 comments on commit 57566d0

Please sign in to comment.