about summary refs log tree commit homepage
path: root/lib/unicorn.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-29 22:47:37 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-29 22:47:37 -0700
commit49acd52b3f67d5be433babc38a28ea6865af38a5 (patch)
treef88912153a27984177df1b6e19c3eb38361b0560 /lib/unicorn.rb
parent2f497f7c47730522418e44d9de49ee962e47ff2e (diff)
downloadunicorn-49acd52b3f67d5be433babc38a28ea6865af38a5.tar.gz
If fstat() fails on an open file descriptor in the master,
something is seriously wrong (like your kernel is broken/buggy)
and trying to restart the worker that owned that file descriptor
is likely masking the symptoms.  Instead let the error propagate
up to the main loop to avoid wasting cycles to restart broken
workers.
Diffstat (limited to 'lib/unicorn.rb')
-rw-r--r--lib/unicorn.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 7081164..ae1de59 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -471,16 +471,8 @@ module Unicorn
     # is stale for >timeout seconds, then we'll kill the corresponding
     # worker.
     def murder_lazy_workers
-      diff = stat = nil
       WORKERS.dup.each_pair do |wpid, worker|
-        stat = begin
-          worker.tmp.stat
-        rescue => e
-          logger.warn "worker=#{worker.nr} PID:#{wpid} stat error: #{e.inspect}"
-          kill_worker(:QUIT, wpid)
-          next
-        end
-        (diff = (Time.now - stat.ctime)) <= timeout and next
+        (diff = (Time.now - worker.tmp.stat.ctime)) <= timeout and next
         logger.error "worker=#{worker.nr} PID:#{wpid} timeout " \
                      "(#{diff}s > #{timeout}s), killing"
         kill_worker(:KILL, wpid) # take no prisoners for timeout violations