diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-18 17:02:08 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-18 17:02:08 -0800 |
commit | 2b6dd7653211d3d6b4cb6a46eec11bbde8cab789 (patch) | |
tree | f2c19d498433c85a2078b389e9ae6fa3a879792d /lib/unicorn/http_server.rb | |
parent | d3ebd339990b0586a5993232302235c26cdb33d9 (diff) | |
download | unicorn-2b6dd7653211d3d6b4cb6a46eec11bbde8cab789.tar.gz |
We don't want to repeatedly reclose the same IOs and keep raising exceptions this way.
Diffstat (limited to 'lib/unicorn/http_server.rb')
-rw-r--r-- | lib/unicorn/http_server.rb | 2 |
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 |