|
|
|
@ -332,9 +332,13 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { |
|
|
|
|
this, selected_->subchannel(), i, |
|
|
|
|
subchannel_list->num_subchannels()); |
|
|
|
|
} |
|
|
|
|
if (selected_->connected_subchannel() != nullptr) { |
|
|
|
|
sd->SetConnectedSubchannelFromLocked(selected_); |
|
|
|
|
} |
|
|
|
|
// Make sure it's in state READY. It might not be if we grabbed
|
|
|
|
|
// the combiner while a connectivity state notification
|
|
|
|
|
// informing us otherwise is pending.
|
|
|
|
|
// Note that CheckConnectivityStateLocked() also takes a ref to
|
|
|
|
|
// the connected subchannel.
|
|
|
|
|
grpc_error* error = GRPC_ERROR_NONE; |
|
|
|
|
if (sd->CheckConnectivityStateLocked(&error) == GRPC_CHANNEL_READY) { |
|
|
|
|
selected_ = sd; |
|
|
|
|
subchannel_list_ = std::move(subchannel_list); |
|
|
|
|
DestroyUnselectedSubchannelsLocked(); |
|
|
|
@ -346,6 +350,7 @@ void PickFirst::UpdateLocked(const grpc_channel_args& args) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Not keeping the previous selected subchannel, so set the latest
|
|
|
|
|
// pending subchannel list to the new subchannel list. We will wait
|
|
|
|
|
// for it to report READY before swapping it into the current
|
|
|
|
|