Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Eric Wong <e@80x24.org>
To: Claudio Poli <masterkain@gmail.com>
Cc: rainbows-public@bogomips.org
Subject: Re: undefined method `process_loop' for #<Unicorn::TCPClient:fd 14>
Date: Sun, 2 Apr 2017 00:26:15 +0000
Message-ID: <20170402002615.GA32751@starla> (raw)
In-Reply-To: <9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com>

Claudio Poli <masterkain@gmail.com> 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 }

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02  0:05 Claudio Poli
2017-04-02  0:26 ` Eric Wong [this message]
2017-04-02  0:32   ` Eric Wong
2017-04-02 23:21     ` Claudio Poli
     [not found]       ` <CANp6QoJXRbPLqmOPpG7XmZBc+oYqLWCcq1ipvOyNEQPXDEwx9Q@mail.gmail.com>
2018-01-19 17:07         ` Eric Wong
     [not found]           ` <B05FC728-A46F-4056-997D-0BEE64A9A110@gmail.com>
2018-01-30 21:13             ` Eric Wong
2017-04-02  1:54 ` [PATCH] workaround for unicorn 5.3.0 Eric Wong

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170402002615.GA32751@starla \
    --to=e@80x24.org \
    --cc=masterkain@gmail.com \
    --cc=rainbows-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox