about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-18 17:02:08 -0800
committerEric Wong <normalperson@yhbt.net>2011-02-18 17:02:08 -0800
commit2b6dd7653211d3d6b4cb6a46eec11bbde8cab789 (patch)
treef2c19d498433c85a2078b389e9ae6fa3a879792d
parentd3ebd339990b0586a5993232302235c26cdb33d9 (diff)
downloadunicorn-2b6dd7653211d3d6b4cb6a46eec11bbde8cab789.tar.gz
We don't want to repeatedly reclose the same IOs
and keep raising exceptions this way.
-rw-r--r--lib/unicorn/http_server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 3a35d7d..db150f3 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -582,7 +582,7 @@ class Unicorn::HttpServer
 
     # closing anything we IO.select on will raise EBADF
     trap(:USR1) { nr = -65536; SELF_PIPE[0].close rescue nil }
-    trap(:QUIT) { alive = nil; LISTENERS.each { |s| s.close rescue nil } }
+    trap(:QUIT) { alive = nil; LISTENERS.each { |s| s.close rescue nil }.clear }
     [:TERM, :INT].each { |sig| trap(sig) { exit!(0) } } # instant shutdown
     logger.info "worker=#{worker.nr} ready"
     m = 0