aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/lb_policy/pick_first
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-04-12 15:08:36 -0700
committerGravatar Mark D. Roth <roth@google.com>2018-04-12 15:08:36 -0700
commit542bceb573b4c52a883f95ff240c6aba473790bc (patch)
tree7660eb1fc119fed412e36c866f7e3001ded3e555 /src/core/ext/filters/client_channel/lb_policy/pick_first
parent75d9edab09f90d70dee2483feffe3e465d870bf1 (diff)
Fix race between READY notification and reffing connected subchannel.
Diffstat (limited to 'src/core/ext/filters/client_channel/lb_policy/pick_first')
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index 03e5c89281..24a0c83b1a 100644
--- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -350,6 +350,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) {
subchannel_list->num_subchannels());
}
if (selected_->connected_subchannel() != nullptr) {
+// FIXME: restructure to work more like RR?
sd->SetConnectedSubchannelFromLocked(selected_);
}
selected_ = sd;
@@ -433,6 +434,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
grpc_connectivity_state_name(connectivity_state()), p->shutdown_,
subchannel_list()->shutting_down(), grpc_error_string(error));
}
+// FIXME: move this to SubchannelData::OnConnectivityChangedLocked()
// If the subchannel list is shutting down, stop watching.
if (subchannel_list()->shutting_down() || error == GRPC_ERROR_CANCELLED) {
StopConnectivityWatchLocked();
@@ -502,7 +504,6 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
case GRPC_CHANNEL_READY: {
// Case 2. Promote p->latest_pending_subchannel_list_ to
// p->subchannel_list_.
- SetConnectedSubchannelFromSubchannelLocked();
if (p->latest_pending_subchannel_list_ == subchannel_list()) {
GPR_ASSERT(p->subchannel_list_ != nullptr);
p->subchannel_list_->ShutdownLocked("finish_update");