Skip to content

Commit

Permalink
disable thread check for postpfork
Browse files Browse the repository at this point in the history
  • Loading branch information
chjasonwu committed Nov 26, 2024
1 parent 74f2458 commit 40f2656
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/ruby/ext/grpc/rb_grpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ static VALUE grpc_rb_prefork(VALUE self) {
"GRPC.prefork already called without a matching "
"GRPC.postfork_{parent,child}");
}
if (!grpc_ruby_initial_thread()) {
rb_raise(rb_eRuntimeError,
"GRPC.prefork and fork need to be called from the same thread "
"that GRPC was initialized on (GRPC lazy-initializes when when "
"the first GRPC object is created");
}
// if (!grpc_ruby_initial_thread()) {
// rb_raise(rb_eRuntimeError,
// "GRPC.prefork and fork need to be called from the same thread "
// "that GRPC was initialized on (GRPC lazy-initializes when when "
// "the first GRPC object is created");
// }
if (g_grpc_rb_num_fork_unsafe_threads > 0) {
rb_raise(
rb_eRuntimeError,
Expand Down Expand Up @@ -434,11 +434,11 @@ static VALUE grpc_rb_postfork_parent(VALUE self) {
"GRPC.postfork_parent must be called only from the parent process "
"after a fork");
}
if (!grpc_ruby_initial_thread()) {
rb_raise(rb_eRuntimeError,
"GRPC.postfork_parent needs to be called from the same thread "
"that GRPC.prefork (and fork) was called from");
}
// if (!grpc_ruby_initial_thread()) {
// rb_raise(rb_eRuntimeError,
// "GRPC.postfork_parent needs to be called from the same thread "
// "that GRPC.prefork (and fork) was called from");
// }
grpc_ruby_init_threads();
g_grpc_rb_prefork_pending = false;
return Qnil;
Expand Down

0 comments on commit 40f2656

Please sign in to comment.