Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-6843][core]Add volatile for the "state"
Fix potential visibility problem for the "state" of Executor The field of "state" is shared and modified by multiple threads. i.e: ```scala Within ExecutorRunner.scala (1) workerThread = new Thread("ExecutorRunner for " + fullId) { override def run() { fetchAndRunExecutor() } } workerThread.start() // Shutdown hook that kills actors on shutdown. (2)shutdownHook = new Thread() { override def run() { killProcess(Some("Worker shutting down")) } } (3)and also the "Actor thread" for worker. ``` I think we should at lease add volatile to ensure the visibility among threads otherwise the worker might send an out-of-date status to the master. https://issues.apache.org/jira/browse/SPARK-6843 Author: lisurprise <[email protected]> Closes apache#5448 from zhichao-li/state and squashes the following commits: a2386e7 [lisurprise] add volatile for state field
- Loading branch information