aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/lb_policy/round_robin
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-09-09 13:48:38 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-09-09 13:48:38 -0700
commite65ff1116158958febacd1131a7c2f84f4e0eb1b (patch)
tree03d6039cd00b1d4f1f16dd41380052029e9ce129 /src/core/ext/lb_policy/round_robin
parentb3405f0a7370857373d71bb6a62e056f37493529 (diff)
Propagate error through grpc_lb_policy_cancel_picks(). Also fix error
reporting (and improve control flow) in on_writable() in tcp_client_posix.c.
Diffstat (limited to 'src/core/ext/lb_policy/round_robin')
-rw-r--r--src/core/ext/lb_policy/round_robin/round_robin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c
index 83aba0f8ba..0c40dcf961 100644
--- a/src/core/ext/lb_policy/round_robin/round_robin.c
+++ b/src/core/ext/lb_policy/round_robin/round_robin.c
@@ -310,7 +310,8 @@ static void rr_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
static void rr_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
uint32_t initial_metadata_flags_mask,
- uint32_t initial_metadata_flags_eq) {
+ uint32_t initial_metadata_flags_eq,
+ grpc_error *error) {
round_robin_lb_policy *p = (round_robin_lb_policy *)pol;
pending_pick *pp;
gpr_mu_lock(&p->mu);
@@ -323,8 +324,9 @@ static void rr_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
grpc_polling_entity_del_from_pollset_set(exec_ctx, pp->pollent,
p->base.interested_parties);
*pp->target = NULL;
- grpc_exec_ctx_sched(exec_ctx, pp->on_complete, GRPC_ERROR_CANCELLED,
- NULL);
+ grpc_exec_ctx_sched(exec_ctx, pp->on_complete,
+ GRPC_ERROR_CREATE_REFERENCING("Pick cancelled",
+ &error, 1), NULL);
gpr_free(pp);
} else {
pp->next = p->pending_picks;
@@ -333,6 +335,7 @@ static void rr_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
pp = next;
}
gpr_mu_unlock(&p->mu);
+ GRPC_ERROR_UNREF(error);
}
static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) {