about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-10-27 02:02:11 +0000
committerEric Wong <normalperson@yhbt.net>2010-10-27 02:02:11 +0000
commit8d626390cecb0134ad2d43a055eacd7856ab44f1 (patch)
tree32fa06f5c1924ba694ef59e089909d0c0cf71557
parent61516865943f1b18370357cd555811807339c1f7 (diff)
downloadunicorn-8d626390cecb0134ad2d43a055eacd7856ab44f1.tar.gz
There is no need to loop in the master_sleep method at all, as
the rest of the code is designed to function even on interrupted
sleeps.

This change is included as part of a larger cleanup in master.
(commit bdc79712e5ac53d39c51e80dfe50aff950e5053f).  From maint:
(cherry picked from commit 10037f2aabb3fab4296fc90c615e7caa9f4a9b53)

Conflicts:

	lib/unicorn.rb
-rw-r--r--lib/unicorn.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 8f490bb..735354f 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -489,12 +489,9 @@ module Unicorn
     # wait for a signal hander to wake us up and then consume the pipe
     # Wake up every second anyways to run murder_lazy_workers
     def master_sleep(sec)
-      begin
-        IO.select([ SELF_PIPE[0] ], nil, nil, sec) or return
-        SELF_PIPE[0].read_nonblock(Const::CHUNK_SIZE, HttpRequest::BUF)
+      IO.select([ SELF_PIPE[0] ], nil, nil, sec) or return
+      SELF_PIPE[0].read_nonblock(Const::CHUNK_SIZE, HttpRequest::BUF)
       rescue Errno::EAGAIN, Errno::EINTR
-        break
-      end while true
     end
 
     def awaken_master