Merge branch 'huh_omg' of github.com:ctiller/grpc into huh_omg

pull/5731/head
Craig Tiller 9 years ago
commit 948fa1b1b5
  1. 14
      src/core/client_config/subchannel.c
  2. 2
      test/core/surface/concurrent_connectivity_test.c

@ -505,7 +505,8 @@ void grpc_connected_subchannel_ping(grpc_exec_ctx *exec_ctx,
elem->filter->start_transport_op(exec_ctx, elem, &op); elem->filter->start_transport_op(exec_ctx, elem, &op);
} }
static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) { static void publish_transport_locked(grpc_exec_ctx *exec_ctx,
grpc_subchannel *c) {
size_t channel_stack_size; size_t channel_stack_size;
grpc_connected_subchannel *con; grpc_connected_subchannel *con;
grpc_channel_stack *stk; grpc_channel_stack *stk;
@ -541,8 +542,6 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
grpc_closure_init(&sw_subchannel->closure, subchannel_on_child_state_changed, grpc_closure_init(&sw_subchannel->closure, subchannel_on_child_state_changed,
sw_subchannel); sw_subchannel);
gpr_mu_lock(&c->mu);
if (c->disconnected) { if (c->disconnected) {
gpr_mu_unlock(&c->mu); gpr_mu_unlock(&c->mu);
gpr_free(sw_subchannel); gpr_free(sw_subchannel);
@ -575,7 +574,6 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
grpc_connectivity_state_set(exec_ctx, &c->state_tracker, GRPC_CHANNEL_READY, grpc_connectivity_state_set(exec_ctx, &c->state_tracker, GRPC_CHANNEL_READY,
"connected"); "connected");
gpr_mu_unlock(&c->mu);
gpr_free((void *)filters); gpr_free((void *)filters);
} }
@ -644,13 +642,11 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
bool iomgr_success) { bool iomgr_success) {
grpc_subchannel *c = arg; grpc_subchannel *c = arg;
if (c->connecting_result.transport != NULL) {
publish_transport(exec_ctx, c);
}
GRPC_SUBCHANNEL_WEAK_REF(c, "connected"); GRPC_SUBCHANNEL_WEAK_REF(c, "connected");
gpr_mu_lock(&c->mu); gpr_mu_lock(&c->mu);
if (c->disconnected) { if (c->connecting_result.transport != NULL) {
publish_transport_locked(exec_ctx, c);
} else if (c->disconnected) {
GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting"); GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting");
} else { } else {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);

@ -25,7 +25,7 @@ void create_loop_destroy(void* actually_an_int) {
grpc_channel_check_connectivity_state(chan, 1); grpc_channel_check_connectivity_state(chan, 1);
grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL); grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL);
GPR_ASSERT(grpc_completion_queue_next( GPR_ASSERT(grpc_completion_queue_next(
cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30), NULL) cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
} }
grpc_channel_destroy(channels[thread_index]); grpc_channel_destroy(channels[thread_index]);

Loading…
Cancel
Save