From 2b3996283df2caa5777dd56b8bc36b29bf749a75 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 2 Mar 2009 18:33:05 -0800 Subject: Handle Errno::EINTR during IO.select in workers If we get woken up during an IO.select, just make a bet that we spent some time doing something else and aggressively try to accept new connections without trying to wait for I/O-readiness notification. --- lib/unicorn.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 31af720..42ac8c0 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -473,6 +473,8 @@ module Unicorn # timeout used so we can detect parent death: ret = IO.select(@listeners, nil, nil, @timeout/2.0) or next ready = ret[0] + rescue Errno::EINTR + ready = @listeners rescue Errno::EBADF => e exit(alive ? 1 : 0) end -- cgit v1.2.3-24-ge0c7