ceresfairfood / fairfood-install

Ansible scripts to install Ceres Fair Food on a server
0 stars 0 forks source link

Mokey-patch in Unicorn config to log a stack trace on timeout #21

Closed dacook closed 2 years ago

dacook commented 2 years ago

It's in the config file because I couldn't figure out how to wrap the gem.

https://github.com/ceresfairfood/fairfood-issues/issues/1881

dacook commented 2 years ago

I tried to create a wrapper but not really sure which way to go: https://github.com/ceresfairfood/fairfood/commit/cd63dc4f16d95dfd88aed806210a6003efaccce8

So this works... is it a good idea?

current/log/killed-workers-stack-trace.log

2022-01-28 15:15:45 +1100
/srv/members.ceresfairfood.org.au/unicorn.rb:28:in `backtrace'
/srv/members.ceresfairfood.org.au/unicorn.rb:28:in `block (3 levels) in reload'
/srv/members.ceresfairfood.org.au/unicorn.rb:26:in `open'
/srv/members.ceresfairfood.org.au/unicorn.rb:26:in `block (2 levels) in reload'
/srv/members.ceresfairfood.org.au/current/app/controllers/admin/debug_controller.rb:35:in `sleep'
/srv/members.ceresfairfood.org.au/current/app/controllers/admin/debug_controller.rb:35:in `timeout'
/srv/members.ceresfairfood.org.au/.gem/ruby/2.5.0/gems/actionpack-5.2.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
...
dacook commented 2 years ago

Manually deployed on staging and production by copy/paste into /srv/members.ceresfairfood.org.au/unicorn.rb

And /etc/init.d/unicord_fairfood upgrade

And confirmed: https://members.ceresfairfood.org.au/admin/debug/timeout

less /srv/members.ceresfairfood.org.au/current/log/killed-workers-stack-trace.log