Commit fb298a0
authored
fix(pick_first): ignore state updates from shut down or replaced subchannels (grpc#12968)
In legacy PickFirstLoadBalancer, when handleNameResolutionError() or
shutdown() is called, subchannel.shutdown() is invoked. Because
ManagedChannelImpl delays subchannel shutdown by 5 seconds
(SUBCHANNEL_SHUTDOWN_DELAY_SECONDS), the old subchannel may complete a
connection attempt during this window and fire READY state updates.
Without a check verifying if the calling subchannel is still the current
active subchannel, PickFirstLoadBalancer publishes a READY picker for
the obsolete subchannel right before its 5-second delayed shutdown task
fires and kills the transport. This leaves the channel permanently stuck
in READY with a dead subchannel picker.
Partially addresses grpc#129581 parent dc26e02 commit fb298a0
2 files changed
Lines changed: 27 additions & 0 deletions
File tree
- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
594 | 617 | | |
595 | 618 | | |
596 | 619 | | |
| |||
0 commit comments