Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRB Exception in thread Ruby-0-Thread-1 multiple connections #4143

Open
shahkia opened this issue Sep 9, 2016 · 0 comments
Open

DRB Exception in thread Ruby-0-Thread-1 multiple connections #4143

shahkia opened this issue Sep 9, 2016 · 0 comments

Comments

@shahkia
Copy link

shahkia commented Sep 9, 2016

Environment

  • JRuby version (9.1.5.0)
  • Operating system Ubuntu

Expected Behavior

  • I expected to perform all operations in clients in multiple DRB connections.

Actual Behavior

  • In each client it throws an exception like below:

Hello, world!
Exception in thread "Ruby-0-Thread-1: /home/shahkia/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/drb/drb.rb:1539" java.nio.channels.ClosedSelectorException
at sun.nio.ch.SelectorImpl.keys(SelectorImpl.java:68)
at org.jruby.util.io.SelectorPool.put(SelectorPool.java:88)
at org.jruby.util.io.SelectExecutor.selectEnd(SelectExecutor.java:59)
at org.jruby.util.io.SelectExecutor.go(SelectExecutor.java:44)
at org.jruby.RubyIO.select(RubyIO.java:3381)
at org.jruby.RubyIO$INVOKER$s$0$3$select.call(RubyIO$INVOKER$s$0$3$select.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:720)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:340)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:340)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:340)
at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:66)
at org.jruby.runtime.Block.call(Block.java:126)
at org.jruby.RubyProc.call(RubyProc.java:324)
at org.jruby.RubyProc.call(RubyProc.java:249)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)
at java.lang.Thread.run(Thread.java:745)

I have 3 DRb servers with same code as bellow and different port:

require 'drb/drb'
class MyApp
def greet
'Hello, world!'
end
end
object = MyApp.new
DRb.start_service('druby://localhost:9999', object)
DRb.thread.join

In client I have:

require 'drb/drb'
DRb.start_service
remote_object = DRbObject.new_with_uri('druby://localhost:9999')
remote_object2 = DRbObject.new_with_uri('druby://localhost:9998')
remote_object3 = DRbObject.new_with_uri('druby://localhost:9997')
100.times do
puts remote_object.greet
10.times do
puts remote_object2.greet
100.times do
puts remote_object2.greet
end
end
end

After running client for more than once, it throws an error like mentioned above. Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant