Skip to content

Commit

Permalink
Round Robin user_data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dgquintas committed Sep 15, 2016
1 parent 24869d5 commit 155b820
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/ext/lb_policy/round_robin/round_robin.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,10 @@ static int rr_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
/* readily available, report right away */
gpr_mu_unlock(&p->mu);
*target = grpc_subchannel_get_connected_subchannel(selected->subchannel);
*user_data = selected->user_data;

if (user_data != NULL) {
*user_data = selected->user_data;
}
if (grpc_lb_round_robin_trace) {
gpr_log(GPR_DEBUG,
"[RR PICK] TARGET <-- CONNECTED SUBCHANNEL %p (NODE %p)",
Expand Down Expand Up @@ -470,7 +473,9 @@ static void rr_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,

*pp->target =
grpc_subchannel_get_connected_subchannel(selected->subchannel);
*pp->user_data = selected->user_data;
if (pp->user_data != NULL) {
*pp->user_data = selected->user_data;
}
if (grpc_lb_round_robin_trace) {
gpr_log(GPR_DEBUG,
"[RR CONN CHANGED] TARGET <-- SUBCHANNEL %p (NODE %p)",
Expand Down

0 comments on commit 155b820

Please sign in to comment.