aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/client_config
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2016-06-01 13:03:17 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2016-06-01 13:03:17 -0700
commit2ec184b3242dc725be2fce7e7afd633c7ba6271c (patch)
tree4d17ea6445069b5a9223325751f483f848e97e5a /src/core/ext/client_config
parent87b75c201a132f3678222d857e0f6b09aa7ac58e (diff)
Fix formatting bug leading to crash
Diffstat (limited to 'src/core/ext/client_config')
-rw-r--r--src/core/ext/client_config/subchannel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c
index c6c7b7a3a0..290cac8a43 100644
--- a/src/core/ext/client_config/subchannel.c
+++ b/src/core/ext/client_config/subchannel.c
@@ -638,10 +638,15 @@ static void subchannel_connected(grpc_exec_ctx *exec_ctx, void *arg,
"connect_failed");
gpr_timespec time_til_next = gpr_time_sub(c->next_attempt, now);
const char *errmsg = grpc_error_string(error);
- gpr_log(GPR_INFO, "Connect failed, retry in %d.%09d seconds: %s",
- time_til_next.tv_sec, time_til_next.tv_nsec, errmsg);
- grpc_error_free_string(errmsg);
+ gpr_log(GPR_INFO, "Connect failed: %s", errmsg);
+ if (gpr_time_cmp(time_til_next, gpr_time_0(time_til_next.clock_type)) <= 0) {
+ gpr_log(GPR_INFO, "Retry immediately");
+ } else {
+ gpr_log(GPR_INFO, "Retry in %d.%09d seconds",
+ time_til_next.tv_sec, time_til_next.tv_nsec);
+ }
grpc_timer_init(exec_ctx, &c->alarm, c->next_attempt, on_alarm, c, now);
+ grpc_error_free_string(errmsg);
}
gpr_mu_unlock(&c->mu);
GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting");