diff options
author | Craig Tiller <ctiller@google.com> | 2016-11-30 13:41:53 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-11-30 13:41:53 -0800 |
commit | 36b3135929cf1561d35039fc9e04e038f5351ed7 (patch) | |
tree | b20b4f6ab4043fae9a170adb711b488be0bd1a59 /src/core/ext/lb_policy | |
parent | 0f97958b64a792e551aa3bde84bb8f53b04de3b4 (diff) | |
parent | 369ddc524a6ca55afb8e8bd6743ed5624e1a94ce (diff) |
Merge branch 'slice_interning' into metadata_filter
Diffstat (limited to 'src/core/ext/lb_policy')
-rw-r--r-- | src/core/ext/lb_policy/grpclb/grpclb.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index ab4af321f6..34fd388920 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -183,16 +183,14 @@ static void wrapped_rr_closure(grpc_exec_ctx *exec_ctx, void *arg, NULL); if (wc_arg->rr_policy != NULL) { - /* if target is NULL, no pick has been made by the RR policy (eg, all + /* if *target is NULL, no pick has been made by the RR policy (eg, all * addresses failed to connect). There won't be any user_data/token * available */ - if (wc_arg->target != NULL) { + if (*wc_arg->target != NULL) { if (!GRPC_MDISNULL(wc_arg->lb_token)) { - GRPC_LOG_IF_ERROR( - "grpclb.initial_metadata_add_lb_token", - initial_metadata_add_lb_token(wc_arg->initial_metadata, - wc_arg->lb_token_mdelem_storage, - GRPC_MDELEM_REF(wc_arg->lb_token))); + initial_metadata_add_lb_token(wc_arg->initial_metadata, + wc_arg->lb_token_mdelem_storage, + GRPC_MDELEM_REF(wc_arg->lb_token)); } else { gpr_log(GPR_ERROR, "No LB token for connected subchannel pick %p (from RR " @@ -1244,12 +1242,15 @@ static void lb_on_response_received(grpc_exec_ctx *exec_ctx, void *arg, gpr_log(GPR_INFO, "Incoming server list identical to current, ignoring."); } + grpc_grpclb_destroy_serverlist(serverlist); } else { /* new serverlist */ if (glb_policy->serverlist != NULL) { /* dispose of the old serverlist */ grpc_grpclb_destroy_serverlist(glb_policy->serverlist); } - /* and update the copy in the glb_lb_policy instance */ + /* and update the copy in the glb_lb_policy instance. This serverlist + * instance will be destroyed either upon the next update or in + * glb_destroy() */ glb_policy->serverlist = serverlist; rr_handover_locked(exec_ctx, glb_policy); |