Skip to content

A platform for community discussion. Free, open, simple.

DEV: Disable Pitchfork `setpgid` in dev/test for debugger support (#37948)

Loïc Guitautd02ae397d5d0
diff --git a/config/pitchfork.conf.rb b/config/pitchfork.conf.rb
index b416a4bc602..8583deff9af 100644
--- a/config/pitchfork.conf.rb
+++ b/config/pitchfork.conf.rb
@@ -37,6 +37,12 @@ spawn_timeout(Integer(ENV["APP_SERVER_SPAWN_TIMEOUT"], exception: false) || 60)
check_client_connection false
+if ENV["RAILS_ENV"] != "production"
+ # Pitchfork defaults to setpgid true, which moves workers into their own process group.
+ # This prevents interactive debuggers (binding.pry, etc.) from reading STDIN.
+ setpgid false
+end
+
before_fork do |server|
Discourse.redis.close