---
lib/unicorn/http_server.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 14a6f9a..8507fe4 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -457,6 +457,8 @@ class Unicorn::HttpServer
next_sleep = 0
logger.error "worker=#{worker.nr} PID:#{wpid} timeout " \
"(#{diff}s > #{@timeout}s), killing"
+ kill_worker(:TRAP, wpid)
+ sleep(0.5)
kill_worker(:KILL, wpid) # take no prisoners for timeout violations
end
next_sleep <= 0 ? 1 : next_sleep
@@ -594,6 +596,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) { worker = nil; LISTENERS.each { |s| s.close rescue nil
}.clear }
+ trap(:TRAP) { logger.info("worker=#{worker.nr} pid:#{$$} received TRAP
signal, showing backtrace:\n#{caller.join("\n")}") }
logger.info "worker=#{worker.nr} ready"
begin
--
1.7.9.5
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying