[SPARK-6843][core]Add volatile for the "state"#5448
[SPARK-6843][core]Add volatile for the "state"#5448zhichao-li wants to merge 1 commit intoapache:masterfrom
Conversation
|
Test build #30020 has started for PR 5448 at commit |
|
From the the code of worker , we can see it pass through the state without any guard, but the state of executors might be changed by the other threads. case RequestWorkerState =>
sender ! WorkerStateResponse(host, port, workerId, **executors.values.toList**,
finishedExecutors.values.toList, drivers.values.toList,
finishedDrivers.values.toList, activeMasterUrl, cores, memory,
coresUsed, memoryUsed, activeMasterWebUiUrl) |
|
Test build #30020 has finished for PR 5448 at commit
|
|
Test PASSed. |
|
I think that's technically right, although I find there are probably hundreds more fields in Spark that should be |
Fix potential visibility problem for the "state" of Executor
The field of "state" is shared and modified by multiple threads. i.e:
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