aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <y-zeng@users.noreply.github.com>2017-12-07 11:57:54 -0800
committerGravatar GitHub <noreply@github.com>2017-12-07 11:57:54 -0800
commitc01a91da2d43e858cace8b34119fa35148818458 (patch)
tree601fa0cb754d94d649d9b691356f3773facbfea2 /src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
parent4ff97d29069022842bc33d103ee383da7f79e324 (diff)
parent625a5c05456a3001ecd4519b133aecd61e5b333b (diff)
Merge pull request #13647 from y-zeng/send_ping
Add on_initiate callback for the send_ping tranport op
Diffstat (limited to 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc')
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index c05557ba6f..df458d339d 100644
--- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -540,7 +540,8 @@ static void rr_notify_on_state_change_locked(grpc_exec_ctx* exec_ctx,
}
static void rr_ping_one_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
- grpc_closure* closure) {
+ grpc_closure* on_initiate,
+ grpc_closure* on_ack) {
round_robin_lb_policy* p = (round_robin_lb_policy*)pol;
const size_t next_ready_index = get_next_ready_subchannel_index_locked(p);
if (next_ready_index < p->subchannel_list->num_subchannels) {
@@ -548,11 +549,14 @@ static void rr_ping_one_locked(grpc_exec_ctx* exec_ctx, grpc_lb_policy* pol,
&p->subchannel_list->subchannels[next_ready_index];
grpc_connected_subchannel* target = GRPC_CONNECTED_SUBCHANNEL_REF(
selected->connected_subchannel, "rr_ping");
- grpc_connected_subchannel_ping(exec_ctx, target, closure);
+ grpc_connected_subchannel_ping(exec_ctx, target, on_initiate, on_ack);
GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, target, "rr_ping");
} else {
GRPC_CLOSURE_SCHED(
- exec_ctx, closure,
+ exec_ctx, on_initiate,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Round Robin not connected"));
+ GRPC_CLOSURE_SCHED(
+ exec_ctx, on_ack,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Round Robin not connected"));
}
}