capistrano-plugins / capistrano-unicorn-nginx

Capistrano tasks for automatic and sensible unicorn + nginx configuration
MIT License
175 stars 81 forks source link

Unicorn doesn't load new application code #72

Closed seanlinsley closed 9 years ago

seanlinsley commented 9 years ago

http://unicorn.bogomips.org/Unicorn/Configurator.html#method-i-preload_app

In addition to reloading the unicorn-specific config settings, SIGHUP will reload application code in the working directory/symlink when workers are gracefully restarted when #preload_app=false (the default).

http://stackoverflow.com/a/8725979/2651774

This is what HUP does to unicorn process:

reloads config file and gracefully restart all workers. If the “preload_app” directive is false (the default), then workers will also pick up any application code changes when restarted. If “preload_app” is true, then application code changes will have no effect.

Which is an issue since the Unicorn config sets preload_app to true.

I got around this by removing that line in a customized version of the template. how has no one else run into this?

rhomeister commented 9 years ago

Strange, because the gem works out of the box for me. No need to change anything to make unicorn pick up application code changes. Could you provide some details about the version of unicorn and the OS you're using?

On 4 June 2015 at 21:56, Sean Linsley notifications@github.com wrote:

http://unicorn.bogomips.org/Unicorn/Configurator.html#method-i-preload_app

In addition to reloading the unicorn-specific config settings, SIGHUP will reload application code in the working directory/symlink when workers are gracefully restarted when #preload_app=false (the default).

http://stackoverflow.com/a/8725979/2651774

This is what HUP does to unicorn process:

reloads config file and gracefully restart all workers. If the “preload_app” directive is false (the default), then workers will also pick up any application code changes when restarted. If “preload_app” is true, then application code changes will have no effect.

Which is an issue since the Unicorn config https://github.com/capistrano-plugins/capistrano-unicorn-nginx/blob/46a717a7579f7549cf9745c09833e0be4faee7a5/lib/generators/capistrano/unicorn_nginx/templates/unicorn.rb.erb#L15 sets preload_app to true.

I got around this by removing that line in a customized version of the template. how has no one else run into this?

— Reply to this email directly or view it on GitHub https://github.com/capistrano-plugins/capistrano-unicorn-nginx/issues/72 .

rhomeister commented 9 years ago

Closing due to lack of feedback. Feel free to reopen.