Take ref to connected subchannel if subchannel starts in state READY.

pull/12878/head
Mark D. Roth 7 years ago
parent 61da050693
commit 6c5569167d
  1. 5
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  2. 5
      src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc

@ -312,11 +312,6 @@ static void pf_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
exec_ctx, p->subchannel_list, "pf_update_includes_selected"); exec_ctx, p->subchannel_list, "pf_update_includes_selected");
} }
p->subchannel_list = subchannel_list; p->subchannel_list = subchannel_list;
if (p->selected->connected_subchannel != NULL) {
sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF(
grpc_subchannel_get_connected_subchannel(sd->subchannel),
"pf_update_includes_selected");
}
p->selected = sd; p->selected = sd;
destroy_unselected_subchannels_locked(exec_ctx, p); destroy_unselected_subchannels_locked(exec_ctx, p);
// If there was a previously pending update (which may or may // If there was a previously pending update (which may or may

@ -179,6 +179,11 @@ grpc_lb_subchannel_list *grpc_lb_subchannel_list_create(
sd->prev_connectivity_state = GRPC_CHANNEL_INIT; sd->prev_connectivity_state = GRPC_CHANNEL_INIT;
sd->curr_connectivity_state = subchannel_connectivity_state; sd->curr_connectivity_state = subchannel_connectivity_state;
sd->pending_connectivity_state_unsafe = subchannel_connectivity_state; sd->pending_connectivity_state_unsafe = subchannel_connectivity_state;
if (sd->curr_connectivity_state == GRPC_CHANNEL_READY) {
sd->connected_subchannel = GRPC_CONNECTED_SUBCHANNEL_REF(
grpc_subchannel_get_connected_subchannel(sd->subchannel),
"ready_at_sl_creation");
}
sd->user_data_vtable = addresses->user_data_vtable; sd->user_data_vtable = addresses->user_data_vtable;
if (sd->user_data_vtable != NULL) { if (sd->user_data_vtable != NULL) {
sd->user_data = sd->user_data =

Loading…
Cancel
Save