From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2CCB32096C; Sun, 2 Apr 2017 00:26:15 +0000 (UTC) Date: Sun, 2 Apr 2017 00:26:15 +0000 From: Eric Wong To: Claudio Poli Cc: rainbows-public@bogomips.org Subject: Re: undefined method `process_loop' for # Message-ID: <20170402002615.GA32751@starla> References: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com> List-Id: Claudio Poli wrote: > hello, > I’m using Rainbows! 5.1.0 and I did a bundle update, unicorn got upgraded from 5.2.0 to 5.3.0 and I’m getting this: > Oops! I totally forget about this project, again. Thanks for the report. Can you give the following a try? Should be compatible with all unicorn 5.1+. (It'll take me a while to test on my Centrino laptop) diff --git a/lib/rainbows/coolio/server.rb b/lib/rainbows/coolio/server.rb index 0d8af8c..a24d65e 100644 --- a/lib/rainbows/coolio/server.rb +++ b/lib/rainbows/coolio/server.rb @@ -6,6 +6,6 @@ class Rainbows::Coolio::Server < Coolio::IO def on_readable return if CONN.size >= MAX - io = @_io.kgio_tryaccept and CL.new(io).attach(LOOP) + io = @_io.kgio_tryaccept(Rainbows::Client) and CL.new(io).attach(LOOP) end end diff --git a/lib/rainbows/epoll/server.rb b/lib/rainbows/epoll/server.rb index ab5a49f..daa6df3 100644 --- a/lib/rainbows/epoll/server.rb +++ b/lib/rainbows/epoll/server.rb @@ -23,7 +23,7 @@ def self.extended(sock) def epoll_run return EP.delete(self) if @@nr >= MAX - while io = kgio_tryaccept + while io = kgio_tryaccept(Rainbows::Client) @@nr += 1 # there's a chance the client never even sees epoll for simple apps io.epoll_once diff --git a/lib/rainbows/fiber/coolio/server.rb b/lib/rainbows/fiber/coolio/server.rb index 3d8d85e..51c4054 100644 --- a/lib/rainbows/fiber/coolio/server.rb +++ b/lib/rainbows/fiber/coolio/server.rb @@ -17,7 +17,7 @@ def close def on_readable return if Rainbows.cur >= MAX - c = @io.kgio_tryaccept and Fiber.new { process(c) }.resume + c = @io.kgio_tryaccept(Rainbows::Client) and Fiber.new { process(c) }.resume end def process(io) diff --git a/lib/rainbows/fiber_spawn.rb b/lib/rainbows/fiber_spawn.rb index 2c6d13d..3f0ec4a 100644 --- a/lib/rainbows/fiber_spawn.rb +++ b/lib/rainbows/fiber_spawn.rb @@ -23,7 +23,7 @@ def worker_loop(worker) # :nodoc: begin schedule do |l| break if Rainbows.cur >= limit - io = l.kgio_tryaccept or next + io = l.kgio_tryaccept(Rainbows::Client) or next Fiber.new { process(io) }.resume end rescue => e diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index 63d57cb..04305ed 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -38,7 +38,7 @@ def worker_loop(worker) # :nodoc: def sync_worker # :nodoc: s = LISTENERS[0] begin - c = s.kgio_accept and c.process_loop + c = s.kgio_accept(Rainbows::Client) and c.process_loop rescue => e Rainbows::Error.listen_loop(e) end while Rainbows.alive @@ -52,7 +52,7 @@ def async_worker # :nodoc: # problem. On the other hand, a thundering herd may not # even incur as much overhead as an extra Mutex#synchronize ret = select(LISTENERS) and ret[0].each do |s| - s = s.kgio_tryaccept and s.process_loop + s = s.kgio_tryaccept(Rainbows::Client) and s.process_loop end rescue Errno::EINTR rescue => e diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index b304688..8ea75bf 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -29,7 +29,7 @@ def accept_loop(klass) #:nodoc: begin if lock.synchronize { nr >= limit } worker_yield - elsif client = l.kgio_accept + elsif client = l.kgio_accept(Rainbows::Client) klass.new(client) do |c| begin lock.synchronize { nr += 1 }