Commit 228fc8e
committed
core: PickFirstLB should not return a subchannel during CONNECTING
This is a follow-up from noticing a breakage in gRPC-LB because it
wasn't checking if the connectivity state changed even if the picker was
identical.
lb_serverStatusCodeConversion() has been misleading since 42e1829
("xds: Do RLS fallback policy eagar start"). At that point, the
subchannel it marked as READY was for the default target's policy, not
the policy for wilderness. However, since old PF policy provided a
subchannel when CONNECTING, everything was "fine", but RLS would
mistakenly count toward target_picks.
This demonstrates that RLS target_picks has been broken since it was
introduced for PF, as PF relied on the caller to avoid the picker when
it was CONNECTING. This may have been hard to notice in production, as
the metrics become correct as soon as the connection is established, so
as long as you use the channel for a while, the duplicate counting would
become a small percentage of the overall amount.1 parent a1a7363 commit 228fc8e
File tree
3 files changed
+13
-17
lines changed- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
- rls/src/test/java/io/grpc/rls
3 files changed
+13
-17
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
| 408 | + | |
410 | 409 | | |
411 | 410 | | |
412 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
220 | | - | |
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
289 | 288 | | |
290 | 289 | | |
291 | 290 | | |
| |||
431 | 430 | | |
432 | 431 | | |
433 | 432 | | |
434 | | - | |
| 433 | + | |
435 | 434 | | |
436 | 435 | | |
437 | 436 | | |
| |||
536 | 535 | | |
537 | 536 | | |
538 | 537 | | |
539 | | - | |
540 | | - | |
| 538 | + | |
541 | 539 | | |
542 | 540 | | |
543 | 541 | | |
| |||
0 commit comments