Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Java::JavaNioChannels::CancelledKeyException #46

Closed
romansergey opened this issue Mar 21, 2013 · 1 comment
Closed

Java::JavaNioChannels::CancelledKeyException #46

romansergey opened this issue Mar 21, 2013 · 1 comment

Comments

@romansergey
Copy link

While making another take on the issue #44
I've made a modification in gist https://gist.github.com/romansergey/5103388 :
Instead of initializing a pool, I've created a single actor:
@actor_pool = TestActor.new
and also bombed the server with ab
ab -c 1000 -n 5000 -k http://localhost:3000/

In most cases it crashes before serving the first 1k of requests with the following exception:

E, [2013-03-21T20:47:13.052000 #20440] ERROR -- : MyServer crashed!
Java::JavaNioChannels::CancelledKeyException: 
    sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:73)
    sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:87)
    org.nio4r.Nio4r$Selector.processKey(Nio4r.java:300)
    org.nio4r.Nio4r$Selector.select(Nio4r.java:248)
    org.nio4r.Nio4r$Selector$INVOKER$i$select.call(Nio4r$Selector$INVOKER$i$select.gen)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    rubyjit.Celluloid::IO::Reactor$$run_once_EC1FDB5E62FA19632A31BC859A049995CBB7493E1623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/reactor.rb:49)
    rubyjit.Celluloid::IO::Reactor$$run_once_EC1FDB5E62FA19632A31BC859A049995CBB7493E1623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/reactor.rb)
    org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:42)
    org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb:53)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb)
    org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:42)
    org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
    org.jruby.ast.IfNode.interpret(IfNode.java:110)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
    org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:133)
    org.jruby.runtime.Block.yieldSpecific(Block.java:99)
    org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
    org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
    org.jruby.runtime.Block.call(Block.java:89)
    org.jruby.RubyProc.call(RubyProc.java:261)
    org.jruby.RubyProc.call19(RubyProc.java:249)
    org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:196)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
    org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
    org.jruby.runtime.Block.call(Block.java:89)
    org.jruby.RubyProc.call(RubyProc.java:261)
    org.jruby.RubyProc.call(RubyProc.java:213)
    org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:98)
    java.lang.Thread.run(Thread.java:722)
E, [2013-03-21T20:47:14.404000 #20440] ERROR -- : thread crashed
Java::JavaNioChannels::CancelledKeyException: 
    sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:73)
    sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:87)
    org.nio4r.Nio4r$Selector.processKey(Nio4r.java:300)
    org.nio4r.Nio4r$Selector.select(Nio4r.java:248)
    org.nio4r.Nio4r$Selector$INVOKER$i$select.call(Nio4r$Selector$INVOKER$i$select.gen)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    rubyjit.Celluloid::IO::Reactor$$run_once_EC1FDB5E62FA19632A31BC859A049995CBB7493E1623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/reactor.rb:49)
    rubyjit.Celluloid::IO::Reactor$$run_once_EC1FDB5E62FA19632A31BC859A049995CBB7493E1623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/reactor.rb)
    org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:42)
    org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb:53)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb)
    rubyjit.Celluloid::IO::Mailbox$$receive_3620F6E26F15C2E33D05EDCA22ECF3DDA2CDB4381623557144.__file__(/home/forker/.rvm/gems/jruby-1.7.2/bundler/gems/celluloid-io-c15a60b73bfd/lib/celluloid/io/mailbox.rb)
    org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:42)
    org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
    org.jruby.ast.IfNode.interpret(IfNode.java:110)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
    org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:133)
    org.jruby.runtime.Block.yieldSpecific(Block.java:99)
    org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
    org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
    org.jruby.runtime.Block.call(Block.java:89)
    org.jruby.RubyProc.call(RubyProc.java:261)
    org.jruby.RubyProc.call19(RubyProc.java:249)
    org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:196)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
    org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
    org.jruby.runtime.Block.call(Block.java:89)
    org.jruby.RubyProc.call(RubyProc.java:261)
    org.jruby.RubyProc.call(RubyProc.java:213)
    org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:98)
    java.lang.Thread.run(Thread.java:722)

@tarcieri
Copy link
Member

tarcieri commented Apr 1, 2013

Closing as an nio4r issue

@tarcieri tarcieri closed this as completed Apr 1, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants