From 87aef35405263fd67ad6b78ed9977366915904e7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Apr 2009 11:28:27 -0700 Subject: Fix log rotation being delayed in workers when idle 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. --- lib/unicorn.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- cgit v1.2.3-24-ge0c7