capistrano-plugins / capistrano-unicorn-nginx

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

Don't kill old master process. Allow unicorn to either upgrade or rev… #113

Open dsturrock opened 3 years ago

dsturrock commented 3 years ago

…ert it

The oldsig QUIT instruction no longer seems to be necessary. Sending USR2 to unicorn is enough to spin up the new master and either drop the old master process once the new master starts successfully or roll back to the old master if the new master fails.

The upgrade step also sometimes incorrectly returns a success message when unicorn has not started, or failed to upgrade. Currently it waits two seconds then attempts to send a 0 signal to the PID. This has been updated to wait 20 seconds to give unicorn plenty of time to start, and will also check to see if the PID changed or if it was reset back to the old master, returning a failure message to indicate this.

This may be a breaking change if there are older versions of unicorn/other gems that DO require the oldsig QUIT to be sent, so if you'd prefer this could be implemented as a 'safe_upgrade' command rather than changing the upgrade path.

114

rhomeister commented 3 years ago

Hi @dsturrock,

I'm no longer maintaining this gem. We have moved on from using capistrano, and switched to kubernetes. Since it is not possible for me to test these changes anymore, and I don't want to take the risk of potentially causing issues for other users of this gem, I'd encourage you to use the fork that you've created in your projects.

Thanks for your contribution. This issue will remain open so others will be directed to your fork if they experience the same problems.