diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-16 08:25:32 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-16 08:55:56 +0000 |
commit | cca4c46dd8cd72afedd9c5d024d47b4554f00c53 (patch) | |
tree | c87b932aeff41f8e19d2e7fae0072b8a1fac472e /lib/unicorn.rb | |
parent | d1818d26b0ca491dac861f3c2d9e249b665269a4 (diff) | |
download | unicorn-cca4c46dd8cd72afedd9c5d024d47b4554f00c53.tar.gz |
In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com (cherry picked from commit f1d33c80dd6c5650f960f7087f4e08f809754d34)
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r-- | lib/unicorn.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb index c231a4d..8f490bb 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -423,10 +423,12 @@ module Unicorn respawn = false logger.info "gracefully stopping all workers" kill_each_worker(:QUIT) + self.worker_processes = 0 else logger.info "SIGWINCH ignored because we're not daemonized" end when :TTIN + respawn = true self.worker_processes += 1 when :TTOU self.worker_processes -= 1 if self.worker_processes > 0 |