Don't kill old master process. Allow unicorn to either upgrade or rev… #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…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