Merge pull request #19556 from gnossen/subprocess_gevent

Fix segfault when forking while using gevent
pull/19653/head
Richard Belleville 6 years ago committed by GitHub
commit 7f54da6bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/lib/iomgr/ev_posix.cc
  2. 6
      src/core/lib/iomgr/fork_posix.cc

@ -206,7 +206,8 @@ void grpc_register_event_engine_factory(const char* name,
GPR_ASSERT(false);
}
/* Call this only after calling grpc_event_engine_init() */
/*If grpc_event_engine_init() has been called, returns the poll_strategy_name.
* Otherwise, returns nullptr. */
const char* grpc_get_poll_strategy_name() { return g_poll_strategy_name; }
void grpc_event_engine_init(void) {

@ -59,8 +59,10 @@ void grpc_prefork() {
"environment variable GRPC_ENABLE_FORK_SUPPORT=1");
return;
}
if (strcmp(grpc_get_poll_strategy_name(), "epoll1") != 0 &&
strcmp(grpc_get_poll_strategy_name(), "poll") != 0) {
const char* poll_strategy_name = grpc_get_poll_strategy_name();
if (poll_strategy_name == nullptr ||
(strcmp(poll_strategy_name, "epoll1") != 0 &&
strcmp(poll_strategy_name, "poll") != 0)) {
gpr_log(GPR_INFO,
"Fork support is only compatible with the epoll1 and poll polling "
"strategies");

Loading…
Cancel
Save