-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Rinda:RingServer not working (used for spork) #3883
Comments
I suspect both of these would be fixed by my socket branch, which is unfortunately still a work in progress. You might check it out... it's the |
Thanks for your fast reply. # Variant 1 10:19 $ jruby -S ring_server.rb TypeError: no implicit conversion of Fixnum into String udp at org/jruby/ext/socket/Addrinfo.java:503 make_socket at /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/rinda/ring.rb:134 block in initialize at /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/rinda/ring.rb:110 each at org/jruby/RubyArray.java:1593 initialize at /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/rinda/ring.rb:106 at ring_server.rb:6 Exception in thread "Ruby-0-Thread-1: /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/drb/drb.rb:1539" java.nio.channels.ClosedSelectorException at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:83) at sun.nio.ch.SelectorImpl.selectNow(SelectorImpl.java:105) at org.jruby.util.io.SelectExecutor.selectEnd(SelectExecutor.java:63) at org.jruby.util.io.SelectExecutor.go(SelectExecutor.java:44) at org.jruby.RubyIO.select(RubyIO.java:3361) at org.jruby.RubyIO$INVOKER$s$0$3$select_DBG.call(RubyIO$INVOKER$s$0$3$select_DBG.gen) at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:720)✘-1 # Variant 2 10:19 $ jruby -S ring_server.rb Ring server up and running Exception in thread "Ruby-0-Thread-2: /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/rinda/ring.rb:177" java.nio.channels.NotYetConnectedException at sun.nio.ch.DatagramChannelImpl.read(DatagramChannelImpl.java:555) at org.jruby.ext.socket.RubyBasicSocket.doRead(RubyBasicSocket.java:485) at org.jruby.ext.socket.RubyBasicSocket.recv(RubyBasicSocket.java:185) at org.jruby.ext.socket.RubyBasicSocket.recv(RubyBasicSocket.java:145) at org.jruby.ext.socket.RubyBasicSocket$INVOKER$i$recv_DBG.call(RubyBasicSocket$INVOKER$i$recv_DBG.gen) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:55) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:301) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77) at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132) at org.jruby.runtime.InterpretedIRBlockBody.commonYieldPath(InterpretedIRBlockBody.java:141) at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:77) at org.jruby.runtime.Block.yieldSpecific(Block.java:136) at org.jruby.RubyKernel.loop(RubyKernel.java:1290) at org.jruby.RubyKernel$INVOKER$s$0$0$loop_DBG.call(RubyKernel$INVOKER$s$0$0$loop_DBG.gen) at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:497) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83) at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:423) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77) at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132) at org.jruby.runtime.InterpretedIRBlockBody.commonYieldPath(InterpretedIRBlockBody.java:141) 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:342) at org.jruby.RubyProc.call(RubyProc.java:248) at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104) at java.lang.Thread.run(Thread.java:745) ^CException in thread "Ruby-0-Thread-1: /usr/local/var/rbenv/versions/jruby9100-socket/lib/ruby/stdlib/drb/drb.rb:1539" java.nio.channels.ClosedSelectorException at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:83) at sun.nio.ch.SelectorImpl.selectNow(SelectorImpl.java:105) |
Ok. We are wrapping up 9.1.1.0 to get some quick fixes out for 9.1, but then we can start to look into this together. It may be a good example case to get socket work finished. Make sure you've provided everything I need to reproduce this. If you want to start looking into it yourself, socket classes are here: https://github.com/jruby/jruby/tree/ruby-2.3+socket/core/src/main/java/org/jruby/ext/socket |
Today I tested it with 9.1.3.0 and got the same exceptions. The socket-branch wasn't updated yet, so I didn't test it - if you update it from master, I can repeat the test there. |
This will definitely fall into the work @etehtsea is doing to help us get socket logic up-to-date. |
This is still a problem on master, but won't get into 9.2 release. If we can do a one-off fix, it could get into 9.2.1. But I suspect this may need the BIG move of switching to an FFI-based socket library. |
Still a problem in 9.2.1 and I don't think we're going to have cycles to investigate it. The error is largely the same, modulo the move away from Fixnum in Ruby 2.5 (JRuby 9.2):
|
Circling back to this after several years. Good news: variant 2 appears to work now and the ring server starts up. Variant 1 still fails due to Rinda passing in a numeric host of |
Numeric hosts can be converted to a byte sequence for address lookup. Fixes jruby#3883
I tried to use spork, but it showed me several errors related to
Rinda:Ring
(see below).It worked on jruby 1.7.22...
Environment
Expected Behavior
Given a script containing this
I would expect the output "Ring server up and running".
When I use
gem install spork
and runspork
it should not show exceptionsActual Behavior
When using Variant 1, I get the exception
When using Variant 2, I get the exception
spork
cannot start any workers, because they can't connect to the Ring ServerThe text was updated successfully, but these errors were encountered: