Celluloid::TimeoutError: linking timeout of 5 seconds exceeded

390 views Asked by At

I'm working with Jruby 1.7.12 and Celluloid (0.16.0). My application is using pools and generates actors in a loop

require 'kaiwa'
Kaiwa::Launcher.run
Celluloid.logger = Kaiwa::Logger.logger

class KaiwaTest
  include Celluloid
  Celluloid::LINKING_TIMEOUT = 5

  def initialize
  end

  def create_kaiwa_users(handle)
    Kaiwa::Manager.create_user(handle)
  end

 def send_kaiwa_messages(to_handle, from_handle, message)
   Kaiwa::Manager.send_message(to_handle, from_handle, message)
 end
end

kt = KaiwaTest.pool(size: 4)

(0..1_00_000).to_a.each do |index|
  kaiwa_test_pool.async.create_kaiwa_users("user_#{index}") 
 end

Within my library each user is an actor which gets linked to the manager, which is also an actor. I've tried eliminating the linking altogether and the problem still persists. The minute i create more than 30 user actors my system hangs.

There seems to be some similar timeout errors discussed with a mention of a JRuby issue but nothing that specifically touches the linking timeout issue. I cannot figure out what is causing the issue.

Thanks in advance.

The entire codebase is available at https://github.com/supersid/kaiwa

Would appreciate any help I can get.

1

There are 1 answers

0
digitalextremist On

Interesting project ( XMPP +Celluloid +jRuby )

I'm assuming kaiwa_test_pool ought to be kt?

I would give this a try using 0.17.0:

You do not need a Pool here. You just need a specialized Supervision::Container

What you need to do is instantiate a Manager, using Kaiwa::Manager.supervise as: :manager

Then instantiate a supervision container for your user actors.

Not sure why you create 0..1_00_000 users?

Either way, no Pool needed, use 0.17.0 and use a plain supervision container.