From 99f54e1572d27a7e7b80918c0cf3cd9614751886 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 16 Oct 2017 09:55:53 -0700 Subject: [PATCH] Code review changes. --- .../client_channel/lb_policy/pick_first/pick_first.cc | 5 +---- .../ext/filters/client_channel/lb_policy/subchannel_list.cc | 6 +++--- 2 files changed, 4 insertions(+), 7 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 025ee290813..970751ce2c7 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 @@ -409,11 +409,8 @@ static void pf_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, exec_ctx, p->subchannel_list, "selected_not_ready+switch_to_update"); p->subchannel_list = p->latest_pending_subchannel_list; p->latest_pending_subchannel_list = NULL; - grpc_lb_subchannel_data *new_sd = - &p->subchannel_list - ->subchannels[p->subchannel_list->checking_subchannel]; grpc_connectivity_state_set( - exec_ctx, &p->state_tracker, new_sd->curr_connectivity_state, + exec_ctx, &p->state_tracker, GRPC_CHANNEL_TRANSIENT_FAILURE, GRPC_ERROR_REF(error), "selected_not_ready+switch_to_update"); } else { if (sd->curr_connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc index 9a7ccedac17..1d2eb395f02 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc @@ -107,7 +107,7 @@ grpc_lb_subchannel_list *grpc_lb_subchannel_list_create( // subchannel keys of subchannels from a different batch of addresses. static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS, GRPC_ARG_LB_ADDRESSES}; - // Create a subchannels for each address. + // Create a subchannel for each address. grpc_subchannel_args sc_args; size_t subchannel_index = 0; for (size_t i = 0; i < addresses->num_addresses; i++) { @@ -245,7 +245,7 @@ void grpc_lb_subchannel_list_unref_for_connectivity_watch( grpc_lb_subchannel_list_unref(exec_ctx, subchannel_list, reason); } -static void grpc_lb_subchannel_data_cancel_connectivity_watch( +static void subchannel_data_cancel_connectivity_watch( grpc_exec_ctx *exec_ctx, grpc_lb_subchannel_data *sd, const char *reason) { if (GRPC_TRACER_ON(*sd->subchannel_list->tracer)) { gpr_log( @@ -275,7 +275,7 @@ void grpc_lb_subchannel_list_shutdown_and_unref( // the callback is responsible for unreffing the subchannel. // Otherwise, unref the subchannel directly. if (sd->connectivity_notification_pending) { - grpc_lb_subchannel_data_cancel_connectivity_watch(exec_ctx, sd, reason); + subchannel_data_cancel_connectivity_watch(exec_ctx, sd, reason); } else if (sd->subchannel != NULL) { grpc_lb_subchannel_data_unref_subchannel(exec_ctx, sd, reason); }