* thread dump?
@ 2023-05-11 14:42 Mike Perham
2023-05-11 18:25 ` Mike Perham
0 siblings, 1 reply; 3+ messages in thread
From: Mike Perham @ 2023-05-11 14:42 UTC (permalink / raw)
To: unicorn-public
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: thread dump?
2023-05-11 14:42 thread dump? Mike Perham
@ 2023-05-11 18:25 ` Mike Perham
2023-05-11 19:01 ` Eric Wong
0 siblings, 1 reply; 3+ messages in thread
From: Mike Perham @ 2023-05-11 18:25 UTC (permalink / raw)
To: unicorn-public
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: thread dump?
2023-05-11 18:25 ` Mike Perham
@ 2023-05-11 19:01 ` Eric Wong
0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2023-05-11 19:01 UTC (permalink / raw)
To: Mike Perham; +Cc: unicorn-public
Mike Perham <mike@perham.net> wrote:
> 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?
(top-posting corrected)
Not by default. I've long recommended adding per-callsite timeouts
throughout the app + libraries for portability across various
Rack servers:
https://yhbt.net/unicorn/Application_Timeouts.html
> > [0]: https://github.com/sidekiq/sidekiq/issues/5876#issuecomment-1529919584
> > [1]: https://github.com/puma/puma/pull/1320
>
> FYI, I got this working with some easy-on-eyes formatting:
>
> after_fork do |server, worker|
> Signal.trap("INFO") do
<snip>
Yes, that works. Pretty much anything can be setup that way,
and at this point there's probably many configs that would be
broken if unicorn started relying on more signals internally.
note to all: disable HTML and use reply-to-all to ensure archival to
https://yhbt.net/unicorn-public/ et al. for future readers.
subscribers: there's a one-click List-Unsubscribe URL in the headers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-11 19:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11 14:42 thread dump? Mike Perham
2023-05-11 18:25 ` Mike Perham
2023-05-11 19:01 ` Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).