about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-16 08:25:32 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-16 08:55:17 +0000
commit5a0506c2affd2f5abe6e7315121e67aa3e32b253 (patch)
tree5476af646fd3ca3f6759c56d149efd72d1c1a2b6 /lib/unicorn.rb
parenta965c0bb48d5b92373f939865212641d810c97d7 (diff)
downloadunicorn-5a0506c2affd2f5abe6e7315121e67aa3e32b253.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 e75ee7615f9875db314a6403964e7b69a68b0521)
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index cbb5520..e2d1ac1 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -422,10 +422,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