From 441bb8ab48f15f583b82a3f8520648a4694a198f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Jun 2011 22:40:20 +0000 Subject: reenable heartbeat checking for idle workers Some applications/libraries may launch background threads which can lock up the process. So we can't disable heartbeat checking just because the main thread is sleeping. This also has the side effect of reducing master process wakeups when all workers are idle. --- lib/unicorn/http_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb index 80983bb..f033764 100644 --- a/lib/unicorn/http_server.rb +++ b/lib/unicorn/http_server.rb @@ -600,7 +600,7 @@ class Unicorn::HttpServer ppid == Process.ppid or return # timeout used so we can detect parent death: - worker.tick = 0 + worker.tick = Time.now.to_i ret = IO.select(l, nil, SELF_PIPE, @timeout) and ready = ret[0] rescue Errno::EBADF nr < 0 or return -- cgit v1.2.3-24-ge0c7