about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-04 22:38:31 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-04 22:38:31 +0000
commitba9a22b6926db058199d44a626b923376c8a850f (patch)
tree9f4bafcd92c7f597e2fe188ceb83bf339471be8d
parentda93ad1c07ff9deb4d3a2e765b26f87ccf68aa23 (diff)
downloadrainbows-ba9a22b6926db058199d44a626b923376c8a850f.tar.gz
We can't work around it effectively in the C extension
itself.  This requires the latest sleepy_penguin gem.
-rw-r--r--lib/rainbows/epoll.rb6
-rw-r--r--lib/rainbows/epoll/server.rb1
-rw-r--r--lib/rainbows/xaccept_epoll.rb1
-rw-r--r--lib/rainbows/xaccept_epoll/client.rb1
-rw-r--r--t/test_isolate.rb2
5 files changed, 3 insertions, 8 deletions
diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb
index 54d08fb..c8c013e 100644
--- a/lib/rainbows/epoll.rb
+++ b/lib/rainbows/epoll.rb
@@ -12,15 +12,9 @@ module Rainbows::Epoll
   autoload :ResponsePipe, 'rainbows/epoll/response_pipe'
   autoload :ResponseChunkPipe, 'rainbows/epoll/response_chunk_pipe'
 
-  def self.quit!
-    Rainbows.quit!
-    EP.close unless EP.closed?
-  end
-
   def init_worker_process(worker)
     super
     Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new
-    trap(:QUIT) { Rainbows::Epoll.quit! }
     Rainbows::Client.__send__ :include, Client
   end
 
diff --git a/lib/rainbows/epoll/server.rb b/lib/rainbows/epoll/server.rb
index 53b87ab..820a6da 100644
--- a/lib/rainbows/epoll/server.rb
+++ b/lib/rainbows/epoll/server.rb
@@ -17,6 +17,7 @@ module Rainbows::Epoll::Server
         obj.epoll_run
       end
       Rainbows::Epoll::Client.expire
+    rescue Errno::EINTR
     rescue => e
       Rainbows::Error.listen_loop(e)
     end while Rainbows.tick || @@nr > 0
diff --git a/lib/rainbows/xaccept_epoll.rb b/lib/rainbows/xaccept_epoll.rb
index 0690c07..94ad332 100644
--- a/lib/rainbows/xaccept_epoll.rb
+++ b/lib/rainbows/xaccept_epoll.rb
@@ -14,7 +14,6 @@ module Rainbows::XAcceptEpoll
   def init_worker_process(worker)
     super
     Rainbows::Epoll.const_set :EP, SleepyPenguin::Epoll.new
-    trap(:QUIT) { Rainbows::Epoll.quit! }
     Rainbows::Client.__send__ :include, Client
   end
 
diff --git a/lib/rainbows/xaccept_epoll/client.rb b/lib/rainbows/xaccept_epoll/client.rb
index 6c3a0f5..f0fecd0 100644
--- a/lib/rainbows/xaccept_epoll/client.rb
+++ b/lib/rainbows/xaccept_epoll/client.rb
@@ -28,6 +28,7 @@ module Rainbows::XAcceptEpoll::Client
     begin
       EP.wait(nil, @timeout) { |flags, obj| obj.epoll_run }
       Rainbows::Epoll::Client.expire
+    rescue Errno::EINTR
     rescue => e
       Rainbows::Error.listen_loop(e)
     end while Rainbows.tick
diff --git a/t/test_isolate.rb b/t/test_isolate.rb
index f9b9d84..b1f6fe6 100644
--- a/t/test_isolate.rb
+++ b/t/test_isolate.rb
@@ -35,7 +35,7 @@ Isolate.now!(opts) do
     gem 'rack-fiber_pool', '0.9.1'
   end
 
-  gem 'sleepy_penguin', '1.3.1' if RUBY_PLATFORM =~ /linux/
+  gem 'sleepy_penguin', '1.4.0' if RUBY_PLATFORM =~ /linux/
 end
 
 $stdout.reopen(old_out)