FYI, I got this working with some easy-on-eyes formatting:

after_fork do |server, worker|
    Signal.trap("INFO") do
        Thread.list.each do |th|
            puts("====\n#{th.inspect} #{th.backtrace.join("\n\t")}")
        end
    end
end

On Thu, May 11, 2023, at 07:42, Mike Perham wrote:
> Hi, is there a way to get a thread dump for a Unicorn process? I have a 
> Unicorn which is hanging[0] and I can't tell where it is stuck. Sidekiq uses 
> the TTIN (Thread INfo) signal, Puma uses the INFO signal[1]. Does unicorn 
> have similar?
> 
> [0]: https://github.com/sidekiq/sidekiq/issues/5876#issuecomment-1529919584
> [1]: https://github.com/puma/puma/pull/1320
> 
> Mike

Reply via email to