diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/channel/client_channel.c | 3 | ||||
-rw-r--r-- | src/core/client_config/lb_policies/pick_first.c | 12 | ||||
-rw-r--r-- | src/core/client_config/subchannel.c | 4 | ||||
-rw-r--r-- | src/core/iomgr/fd_posix.c | 1 | ||||
-rw-r--r-- | src/core/surface/channel_create.c | 1 | ||||
-rw-r--r-- | src/core/surface/secure_channel_create.c | 1 |
6 files changed, 18 insertions, 4 deletions
diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c index 6815ec8718..95afc0d2e3 100644 --- a/src/core/channel/client_channel.c +++ b/src/core/channel/client_channel.c @@ -436,6 +436,9 @@ static void cc_start_transport_op(grpc_channel_element *elem, GRPC_CHANNEL_FATAL_FAILURE); destroy_resolver = chand->resolver; chand->resolver = NULL; + if (chand->lb_policy != NULL) { + grpc_lb_policy_shutdown(chand->lb_policy); + } } if (!is_empty(op, sizeof(*op))) { diff --git a/src/core/client_config/lb_policies/pick_first.c b/src/core/client_config/lb_policies/pick_first.c index ffdae75b28..3967350a9b 100644 --- a/src/core/client_config/lb_policies/pick_first.c +++ b/src/core/client_config/lb_policies/pick_first.c @@ -85,8 +85,16 @@ void pf_destroy(grpc_lb_policy *pol) { } void pf_shutdown(grpc_lb_policy *pol) { - /* pick_first_lb_policy *p = (pick_first_lb_policy*)pol; */ - abort(); + pick_first_lb_policy *p = (pick_first_lb_policy*)pol; + pending_pick *pp; + gpr_mu_lock(&p->mu); + while ((pp = p->pending_picks)) { + p->pending_picks = pp->next; + *pp->target = NULL; + grpc_iomgr_add_delayed_callback(pp->on_complete, 0); + gpr_free(pp); + } + gpr_mu_unlock(&p->mu); } void pf_pick(grpc_lb_policy *pol, grpc_pollset *pollset, diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c index cde14b9222..05fd02fb0a 100644 --- a/src/core/client_config/subchannel.c +++ b/src/core/client_config/subchannel.c @@ -562,6 +562,9 @@ static void on_alarm(void *arg, int iomgr_success) { grpc_subchannel *c = arg; gpr_mu_lock(&c->mu); c->have_alarm = 0; + if (c->disconnected) { + iomgr_success = 0; + } connectivity_state_changed_locked(c); gpr_mu_unlock(&c->mu); if (iomgr_success) { @@ -609,7 +612,6 @@ static grpc_connectivity_state compute_connectivity_locked(grpc_subchannel *c) { static void connectivity_state_changed_locked(grpc_subchannel *c) { grpc_connectivity_state current = compute_connectivity_locked(c); - gpr_log(GPR_DEBUG, "SUBCHANNEL constate=%d", current); grpc_connectivity_state_set(&c->state_tracker, current); } diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c index afecccae17..2075c43945 100644 --- a/src/core/iomgr/fd_posix.c +++ b/src/core/iomgr/fd_posix.c @@ -159,7 +159,6 @@ void grpc_fd_global_shutdown(void) { grpc_fd *grpc_fd_create(int fd, const char *name) { grpc_fd *r = alloc_fd(fd); - gpr_log(GPR_DEBUG, "FD %d %p create", r->fd, r); grpc_iomgr_register_object(&r->iomgr_object, name); return r; } diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 280927834b..09b4fb782b 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -117,6 +117,7 @@ static void subchannel_factory_ref(grpc_subchannel_factory *scf) { static void subchannel_factory_unref(grpc_subchannel_factory *scf) { subchannel_factory *f = (subchannel_factory *)scf; if (gpr_unref(&f->refs)) { + grpc_channel_args_destroy(f->merge_args); grpc_mdctx_unref(f->mdctx); gpr_free(f); } diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 998acfc8cf..1dd9e61d0f 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -142,6 +142,7 @@ static void subchannel_factory_ref(grpc_subchannel_factory *scf) { static void subchannel_factory_unref(grpc_subchannel_factory *scf) { subchannel_factory *f = (subchannel_factory *)scf; if (gpr_unref(&f->refs)) { + grpc_channel_args_destroy(f->merge_args); grpc_mdctx_unref(f->mdctx); gpr_free(f); } |