aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2017-10-10 19:00:01 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2017-10-30 12:06:52 -0700
commit6f9985e5513c40242afb74301a96f78bc790c2a1 (patch)
tree50d54f83d9004964ece1bde97da9b2650922c900
parentd573861506ae91d4ae96144911d1382d27f71831 (diff)
Fix SIGV when grpc_channel_stack_init returns errors
-rw-r--r--src/core/ext/filters/client_channel/backup_poller.cc4
-rw-r--r--src/core/ext/filters/client_channel/client_channel.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc
index 3e314c74fa..3b47b6630b 100644
--- a/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/src/core/ext/filters/client_channel/backup_poller.cc
@@ -48,8 +48,8 @@ static gpr_once g_once = GPR_ONCE_INIT;
static gpr_mu g_poller_mu;
static backup_poller* g_poller = NULL; // guarded by g_poller_mu
// g_poll_interval_ms is set only once at the first time
-// grpc_client_channel_start_backup_polling() is call, after that it is treated
-// as const.
+// grpc_client_channel_start_backup_polling() is called, after that it is
+// treated as const.
static int g_poll_interval_ms = DEFAULT_POLL_INTERVAL_MS;
static void init_globals() {
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index 8223f25a33..4332bfd470 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -713,6 +713,7 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
chand->interested_parties = grpc_pollset_set_create();
grpc_connectivity_state_init(&chand->state_tracker, GRPC_CHANNEL_IDLE,
"client_channel");
+ grpc_client_channel_start_backup_polling(exec_ctx, chand->interested_parties);
// Record client channel factory.
const grpc_arg *arg = grpc_channel_args_find(args->channel_args,
GRPC_ARG_CLIENT_CHANNEL_FACTORY);
@@ -754,7 +755,6 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
}
chand->deadline_checking_enabled =
grpc_deadline_checking_enabled(args->channel_args);
- grpc_client_channel_start_backup_polling(exec_ctx, chand->interested_parties);
return GRPC_ERROR_NONE;
}