diff options
author | lisurprise <zhichao.li@intel.com> | 2015-04-12 13:41:44 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-04-12 13:41:44 +0100 |
commit | ddc17431a4108ab6efe0cd329d69e1f2fca5ac12 (patch) | |
tree | cef664b23999f2af70ef30a964e5d4ddc2d844f1 /external | |
parent | e9445b187e8f5c3703771b775e60164166309570 (diff) | |
download | spark-ddc17431a4108ab6efe0cd329d69e1f2fca5ac12.tar.gz spark-ddc17431a4108ab6efe0cd329d69e1f2fca5ac12.tar.bz2 spark-ddc17431a4108ab6efe0cd329d69e1f2fca5ac12.zip |
[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 <zhichao.li@intel.com>
Closes #5448 from zhichao-li/state and squashes the following commits:
a2386e7 [lisurprise] add volatile for state field
Diffstat (limited to 'external')
0 files changed, 0 insertions, 0 deletions