We have a rails app that uses temporal which we are moving to production and whenever we set RAILS_ENV=production we are getting the following error:
RuntimeError: grpc cannot be used before and after forking unless the GRPC_ENABLE_FORK_SUPPORT env var is set to "1" and the platform supports it (linux only)
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:49:in `new'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:49:in `setup_channel'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:104:in `initialize'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/service.rb:158:in `initialize'
temporal-ruby (3e0dae708ec0) lib/temporal/connection/grpc.rb:798:in `new'
And after setting GRPC_ENABLE_FORK_SUPPORT=1 we then get this:
RuntimeError: grpc is in a broken state: GRPC.prefork must be called before calling fork from a process using grpc
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:49:in `new'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:49:in `setup_channel'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/client_stub.rb:104:in `initialize'
grpc-1.60.0-x86_64 (linux) src/ruby/lib/grpc/generic/service.rb:158:in `initialize'
Wondering if someone around could shed some light based on this errors.