Heroku - why should I get an error R12 (exit timeout) when I press release on Heroku?

Sometimes, when I press the release on Heroku shortly after I get the following error (I start 2,512 MB speakers):

2014-11-21 00:38:30.216 188 <45>1 2014-11-21T00:38:29.163459+00:00 heroku web.2 - - Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 

I use the application server for a unicorn, unfortunately, only one person per one unicorn has 512 MB of dino (since at its peak, my RSS application is 320 MB - yes, go figure, there is some bloating). Not sure if this helps, but I'm on Cedar14 with Preboot enabled. UNICORN_WORKERS set to 1.

Here is my unicorn setting. Should I worry about this error?

And although we are discussing this topic, the db 15 pool size is too large for my two dinosaurs (I use the Postgres standard, which allows up to 120 simultaneous connections).

 worker_processes Integer(ENV['UNICORN_WORKERS'] || 2) timeout Integer(ENV['UNICORN_TIMEOUT'] || 25) preload_app true before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end if defined?(ActiveRecord::Base) ActiveRecord::Base.connection.disconnect! end end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' end # other settings if defined?(ActiveRecord::Base) config = ActiveRecord::Base.configurations[Rails.env] || Rails.application.config.database_configuration[Rails.env] config['reaping_frequency'] = Integer(ENV['DB_REAPING_FREQUENCY'] || 10) config['pool'] = ENV['DB_POOL'] || 15 ActiveRecord::Base.establish_connection(config) end end 
+8
heroku unicorn heroku-postgres
source share
1 answer

Heroku has a deployment rule that basically talks about this:

  • When your dyno starts rebooting, Heroku will ask your processes to hide themselves. This gives them the opportunity to do nice things like closing open db connections, etc.
  • If your process does not close within 10 seconds, you will receive the error above, and Heroku will forcefully kill your process in order to restart it.

This is to ensure that you do not have a huge bill, because one of your processes somehow did not go out.

What happens in your case (I'm thinking here) is that you have many open database connections, and it takes more than 10 seconds to close them, because either:

  • You have a DB timeout.
  • Your DB is saddled with other things.
  • Your application simply cannot close so much in <10 seconds.

In general, it doesn’t matter. This problem matures over time, so I will not worry about it.

+9
source share

All Articles