summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-24 01:21:31 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-24 01:21:31 -0700
commite93f84e28f0da4ce7aa21d714f0504677f4bf6f6 (patch)
tree265bc52928adec0c9d5c69bc0afec5a8d91c5ab1
parenta60c5ddaf8082c5a59a68fb0b726a520c4e94e19 (diff)
As long as our speculative accept()s are succeeding, then avoid
checking for master process death and keep processing requests.
This allows us to save some syscalls under extremely heavy
traffic spikes.
-rw-r--r--lib/unicorn.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index c2ac09d..a049b5c 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -471,7 +471,7 @@ module Unicorn
       [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown
       @logger.info "worker=#{worker.nr} ready"
 
-      while alive && master_pid == Process.ppid
+      while alive
         if nr < 0
           @logger.info "worker=#{worker.nr} reopening logs..."
           Unicorn::Util.reopen_logs
@@ -517,6 +517,7 @@ module Unicorn
           if nr != 0 # (nr < 0) => reopen logs
             ready = LISTENERS
           else
+            master_pid == Process.ppid or exit(0)
             begin
               alive.chmod(nr += 1)
               # timeout used so we can detect parent death: