Commit 4bbf8ee
authored
core: Convert AutoConfiguredLB to an actual LB
AutoConfiguredLB wasn't able to be a LB because it needed to be able to
reject configuration to cause the NameResolver to refresh. Since
4b4cb0b, and especially 9888a54, the LB API now is able to do this
directly.
The real end-goal of this work is to replace (much of) AutoConfiguredLB
with GracefulSwitchLB. The AutoConfiguredLBFactory will still be needed
for config handling, but the LB itself could just become an instance of
GracefulSwitchLB. Using GracefulSwitchLB will let us reuse more of the
config parsing logic, avoids a latency hit when the top-level policy
changes, and gets rid of the last usage of
ServiceConfigUtil.selectLbPolicyFromList() outside of GracefulSwitchLB.
Go and C are already using GracefulSwitchLB for the top-level policy.
Moving the defaultProvider creation earlier was to allow
parseLoadBalancingPolicyConfig() to never return null. However, that ran
into some simple but annoying test failures because the service config
was now being detected as changed. That's solveable, but turns out to be
more involved than this change itself, so that's left for later. Since
the error handling is nicer now and the earlier creation will be needed
eventually anyway, I left the earlier creation in-place even though it
technically doesn't have to be done as part of this commit.1 parent 3915d02 commit 4bbf8ee
File tree
6 files changed
+178
-114
lines changed- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
6 files changed
+178
-114
lines changedLines changed: 43 additions & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 72 | | |
81 | | - | |
| 73 | + | |
82 | 74 | | |
83 | 75 | | |
84 | 76 | | |
85 | 77 | | |
86 | 78 | | |
87 | 79 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 80 | + | |
94 | 81 | | |
95 | 82 | | |
96 | 83 | | |
97 | 84 | | |
98 | 85 | | |
99 | 86 | | |
100 | 87 | | |
101 | | - | |
| 88 | + | |
| 89 | + | |
102 | 90 | | |
103 | 91 | | |
104 | 92 | | |
105 | 93 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 94 | | |
119 | 95 | | |
120 | 96 | | |
| |||
145 | 121 | | |
146 | 122 | | |
147 | 123 | | |
148 | | - | |
| 124 | + | |
| 125 | + | |
149 | 126 | | |
150 | 127 | | |
151 | 128 | | |
| 129 | + | |
152 | 130 | | |
153 | | - | |
| 131 | + | |
154 | 132 | | |
155 | 133 | | |
156 | 134 | | |
157 | | - | |
| 135 | + | |
| 136 | + | |
158 | 137 | | |
159 | 138 | | |
160 | 139 | | |
161 | | - | |
| 140 | + | |
| 141 | + | |
162 | 142 | | |
163 | 143 | | |
164 | 144 | | |
| |||
179 | 159 | | |
180 | 160 | | |
181 | 161 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 162 | | |
193 | 163 | | |
194 | 164 | | |
| |||
209 | 179 | | |
210 | 180 | | |
211 | 181 | | |
| 182 | + | |
| 183 | + | |
212 | 184 | | |
213 | | - | |
| 185 | + | |
| 186 | + | |
214 | 187 | | |
215 | 188 | | |
216 | 189 | | |
| |||
228 | 201 | | |
229 | 202 | | |
230 | 203 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
234 | 208 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
238 | 217 | | |
239 | 218 | | |
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
1342 | 1342 | | |
1343 | 1343 | | |
1344 | 1344 | | |
1345 | | - | |
| 1345 | + | |
1346 | 1346 | | |
1347 | 1347 | | |
1348 | 1348 | | |
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
1730 | | - | |
| 1730 | + | |
1731 | 1731 | | |
1732 | 1732 | | |
1733 | 1733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
0 commit comments