Commit 28dbae8
[SPARK-2635] Fix race condition at SchedulerBackend.isReady in standalone mode
In SPARK-1946(PR apache#900), configuration <code>spark.scheduler.minRegisteredExecutorsRatio</code> was introduced. However, in standalone mode, there is a race condition where isReady() can return true because totalExpectedExecutors has not been correctly set.
Because expected executors is uncertain in standalone mode, the PR try to use CPU cores(<code>--total-executor-cores</code>) as expected resources to judge whether SchedulerBackend is ready.
Author: li-zhihui <[email protected]>
Author: Li Zhihui <[email protected]>
Closes apache#1525 from li-zhihui/fixre4s and squashes the following commits:
e9a630b [Li Zhihui] Rename variable totalExecutors and clean codes
abf4860 [Li Zhihui] Push down variable totalExpectedResources to children classes
ca54bd9 [li-zhihui] Format log with String interpolation
88c7dc6 [li-zhihui] Few codes and docs refactor
41cf47e [li-zhihui] Fix race condition at SchedulerBackend.isReady in standalone mode1 parent 43af281 commit 28dbae8
File tree
5 files changed
+43
-32
lines changed- core/src/main/scala/org/apache/spark/scheduler/cluster
- docs
- yarn/common/src/main/scala/org/apache/spark/scheduler/cluster
5 files changed
+43
-32
lines changedLines changed: 14 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | | - | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 97 | + | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
| |||
268 | 263 | | |
269 | 264 | | |
270 | 265 | | |
| 266 | + | |
| 267 | + | |
271 | 268 | | |
272 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
276 | | - | |
277 | 275 | | |
278 | | - | |
| 276 | + | |
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
| 831 | + | |
| 832 | + | |
832 | 833 | | |
833 | | - | |
| 834 | + | |
834 | 835 | | |
835 | | - | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
839 | | - | |
| 840 | + | |
840 | 841 | | |
841 | 842 | | |
842 | | - | |
| 843 | + | |
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | | - | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
0 commit comments