summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-25 11:28:27 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-25 11:28:27 -0700
commit87aef35405263fd67ad6b78ed9977366915904e7 (patch)
treebbd538564830b0be6c082773a3d719695f763228
parenta1c61a663dbeda29967614ead7cac018281ed9de (diff)
We were closing a no-longer-existent I/O object to break out of
IO.select.  This was broken in 0.6.0 but did not affect the
worker when it was busy.
-rw-r--r--lib/unicorn.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index d1c7eeb..54e2bc0 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -478,7 +478,7 @@ module Unicorn
       client = nil
 
       # closing anything we IO.select on will raise EBADF
-      trap(:USR1) { nr = -65536; rd.close rescue nil }
+      trap(:USR1) { nr = -65536; SELF_PIPE.first.close rescue nil }
       trap(:QUIT) { alive = nil; LISTENERS.each { |s| s.close rescue nil } }
       [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown
       @logger.info "worker=#{worker.nr} ready"