diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/client_config/subchannel.c | 5 | ||||
-rw-r--r-- | src/core/lib/iomgr/error.c | 1 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_client_posix.c | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/timer.c | 5 | ||||
-rw-r--r-- | src/core/lib/security/transport/handshake.c | 5 |
5 files changed, 18 insertions, 0 deletions
diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c index 69b1fa5d34..ead28dbd12 100644 --- a/src/core/ext/client_config/subchannel.c +++ b/src/core/ext/client_config/subchannel.c @@ -606,6 +606,10 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { GRPC_ERROR_REF(error); } if (error != GRPC_ERROR_NONE) { + const char *msg = grpc_error_string(error); + gpr_log(GPR_INFO, "Failed to connect to channel, retrying: %s", msg); + grpc_error_free_string(msg); + c->next_attempt = gpr_backoff_step(&c->backoff_state, gpr_now(GPR_CLOCK_MONOTONIC)); continue_connect(exec_ctx, c); @@ -614,6 +618,7 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { gpr_mu_unlock(&c->mu); GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting"); } + GRPC_ERROR_UNREF(error); } static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg, diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.c index b936ec9652..7e5d74b495 100644 --- a/src/core/lib/iomgr/error.c +++ b/src/core/lib/iomgr/error.c @@ -223,6 +223,7 @@ static grpc_error *copy_error_and_unref(grpc_error *in) { return GRPC_ERROR_CREATE("unknown"); } grpc_error *out = gpr_malloc(sizeof(*out)); + gpr_log(GPR_DEBUG, "%p create copying", out); out->ints = gpr_avl_ref(in->ints); out->strs = gpr_avl_ref(in->strs); out->errs = gpr_avl_ref(in->errs); diff --git a/src/core/lib/iomgr/tcp_client_posix.c b/src/core/lib/iomgr/tcp_client_posix.c index c70f11b40a..9c4ca1617f 100644 --- a/src/core/lib/iomgr/tcp_client_posix.c +++ b/src/core/lib/iomgr/tcp_client_posix.c @@ -128,6 +128,8 @@ static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { grpc_closure *closure = ac->closure; grpc_fd *fd; + GRPC_ERROR_REF(error); + if (grpc_tcp_trace) { const char *str = grpc_error_string(error); gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_writable: error=%s", diff --git a/src/core/lib/iomgr/timer.c b/src/core/lib/iomgr/timer.c index 99a66ee042..b46c6df287 100644 --- a/src/core/lib/iomgr/timer.c +++ b/src/core/lib/iomgr/timer.c @@ -239,6 +239,11 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, } void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer) { + if (!g_initialized) { + /* must have already been cancelled, also the shard mutex is invalid */ + return; + } + shard_type *shard = &g_shards[shard_idx(timer)]; gpr_mu_lock(&shard->mu); if (!timer->triggered) { diff --git a/src/core/lib/security/transport/handshake.c b/src/core/lib/security/transport/handshake.c index b3fc3d56d9..c87262f124 100644 --- a/src/core/lib/security/transport/handshake.c +++ b/src/core/lib/security/transport/handshake.c @@ -107,6 +107,10 @@ static void security_handshake_done(grpc_exec_ctx *exec_ctx, h->cb(exec_ctx, h->user_data, GRPC_SECURITY_OK, h->secure_endpoint, h->auth_context); } else { + const char *msg = grpc_error_string(error); + gpr_log(GPR_ERROR, "Security handshake failed: %s", msg); + grpc_error_free_string(msg); + if (h->secure_endpoint != NULL) { grpc_endpoint_shutdown(exec_ctx, h->secure_endpoint); grpc_endpoint_destroy(exec_ctx, h->secure_endpoint); @@ -123,6 +127,7 @@ static void security_handshake_done(grpc_exec_ctx *exec_ctx, GRPC_AUTH_CONTEXT_UNREF(h->auth_context, "handshake"); GRPC_SECURITY_CONNECTOR_UNREF(h->connector, "handshake"); gpr_free(h); + GRPC_ERROR_UNREF(error); } static void on_peer_checked(grpc_exec_ctx *exec_ctx, void *user_data, |