From 34965961cf15dfdb8cc2a6c290849704771b763e Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Sat, 9 Feb 2019 12:56:02 -0800 Subject: [PATCH 1/2] check grpc is init before creating execctx --- src/core/lib/iomgr/fork_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc index 2eebe3f26f6..0918e7ae1ba 100644 --- a/src/core/lib/iomgr/fork_posix.cc +++ b/src/core/lib/iomgr/fork_posix.cc @@ -47,11 +47,11 @@ bool registered_handlers = false; } // namespace void grpc_prefork() { - grpc_core::ExecCtx exec_ctx; skipped_handler = true; if (!grpc_is_initialized()) { return; } + grpc_core::ExecCtx exec_ctx; if (!grpc_core::Fork::Enabled()) { gpr_log(GPR_ERROR, "Fork support not enabled; try running with the " From b90dd36270be2c0be8bbdf16f49c6ed61f5bdf7c Mon Sep 17 00:00:00 2001 From: Eric Gribkoff Date: Mon, 11 Feb 2019 08:13:06 -0800 Subject: [PATCH 2/2] add comment --- src/core/lib/iomgr/fork_posix.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc index 0918e7ae1ba..7f8fb7e828b 100644 --- a/src/core/lib/iomgr/fork_posix.cc +++ b/src/core/lib/iomgr/fork_posix.cc @@ -48,6 +48,8 @@ bool registered_handlers = false; void grpc_prefork() { skipped_handler = true; + // This may be called after core shuts down, so verify initialized before + // instantiating an ExecCtx. if (!grpc_is_initialized()) { return; }