Can't rescue IOExceptions from jruby-openssl.
---------------------------------------------

                 Key: JRUBY-3416
                 URL: http://jira.codehaus.org/browse/JRUBY-3416
             Project: JRuby
          Issue Type: Bug
          Components: OpenSSL
    Affects Versions: JRuby 1.1.6
            Reporter: Mark Imbriaco



I have a script that creates multiple threads and performs HTTPS uploads to a 
third-party storage service.  It appears that the service occasionally drops 
active connections resulting in an IOException from jruby-openssl, but I'm not 
able to rescue these exceptions.  The Ruby code that performs the upload has a 
begin/rescue block wrapped around the upload, with a "rescue Exception => e" 
but the IOException doesn't seem to get caught by that.

Here's an example stack trace:

Exception in thread "Thread-74" java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcher.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
        at sun.nio.ch.IOUtil.write(IOUtil.java:75)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
        at org.jruby.ext.openssl.SSLSocket.flushData(SSLSocket.java:271)
        at org.jruby.ext.openssl.SSLSocket.write(SSLSocket.java:297)
        at org.jruby.ext.openssl.SSLSocket.syswrite(SSLSocket.java:434)
        at 
org.jruby.ext.openssl.SSLSocket$i_method_1_0$RUBYINVOKER$syswrite.call(org/jruby/ext/openssl/SSLSocket$i_method_1_0$RUBYINVOKER$syswrite.gen)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.gems.$1_dot_8.gems.jruby_minus_openssl_minus_0_dot_3.lib.openssl.buffering.do_write802307701_1437285594.rescue_2$RUBY$__rescue___1(buffering.rb:178)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.gems.$1_dot_8.gems.jruby_minus_openssl_minus_0_dot_3.lib.openssl.buffering.do_write802307701_1437285594.rescue_1$RUBY$__rescue___0(buffering.rb:177)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.gems.$1_dot_8.gems.jruby_minus_openssl_minus_0_dot_3.lib.openssl.buffering.do_write802307701_1437285594.__file__(buffering.rb:175)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.gems.$1_dot_8.gems.jruby_minus_openssl_minus_0_dot_3.lib.openssl.buffering.write1184634322_1069736291.__file__(buffering.rb:192)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.net.protocol.write0843685757_1069736291.__file__(protocol.rb:175)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.net.protocol.write788100239_1069736291.block_0$RUBY$__block__(protocol.rb:151)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.net.protocol.write788100239_1069736291BlockCallback$block_0$RUBY$__block__xx1.call(Unknown
 Source)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:120)
        at org.jruby.runtime.Block.yield(Block.java:124)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.net.protocol.writing1990190694_1437285594.__file__(protocol.rb:166)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:216)
        at 
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:98)
        at 
ruby.jit.ruby.usr.java.jruby_minus_1_dot_1_dot_6.lib.ruby.$1_dot_8.net.protocol.write788100239_1069736291.__file__(protocol.rb:150)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:237)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.WhileNode.interpret(WhileNode.java:128)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.IfNode.interpret(IfNode.java:111)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:183)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:32)
        at org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.IfNode.interpret(IfNode.java:109)
        at org.jruby.ast.IfNode.interpret(IfNode.java:111)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:330)
        at 
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:320)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:198)
        at org.jruby.ast.CallThreeArgNode.interpret(CallThreeArgNode.java:61)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:267)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:124)
        at 
org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:120)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:222)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:144)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:107)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:183)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:32)
        at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:120)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:246)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:156)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:133)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:246)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
u.mysql.scripts.cloudput.cloudput.block_2$RUBY$__block__(cloudput.rb:83)
        at 
u.mysql.scripts.cloudput.cloudputBlockCallback$block_2$RUBY$__block__xx1.call(Unknown
 Source)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:120)
        at org.jruby.runtime.Block.yield(Block.java:124)
        at 
u.mysql.scripts.cloudput.cloudput.method__13$RUBY$delta(cloudput.rb:120)
        at 
u.mysql.scripts.cloudput.cloudputInvokermethod__13$RUBY$deltaFixed0.call(u/mysql/scripts/cloudput/cloudputInvokermethod__13$RUBY$deltaFixed0.gen)
        at 
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:98)
        at 
u.mysql.scripts.cloudput.cloudput.rescue_1$RUBY$__rescue___8(cloudput.rb:83)
        at 
u.mysql.scripts.cloudput.cloudput.method__7$RUBY$upload(cloudput.rb:78)
        at 
u.mysql.scripts.cloudput.cloudputInvokermethod__7$RUBY$uploadFixed1.call(u/mysql/scripts/cloudput/cloudputInvokermethod__7$RUBY$uploadFixed1.gen)
        at 
org.jruby.internal.runtime.methods.CompiledMethod.call(CompiledMethod.java:221)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at 
u.mysql.scripts.cloudput.cloudput.method__7$RUBY$upload(cloudput.rb:91)
        at 
u.mysql.scripts.cloudput.cloudputInvokermethod__7$RUBY$uploadFixed1.call(u/mysql/scripts/cloudput/cloudputInvokermethod__7$RUBY$uploadFixed1.gen)
        at org.jruby.RubyClass.finvoke(RubyClass.java:372)
        at org.jruby.RubyObject.send(RubyObject.java:1364)
        at 
org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:169)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
        at 
u.mysql.scripts.cloudput.cloudput.block_4$RUBY$__block__(cloudput.rb:98)
        at 
u.mysql.scripts.cloudput.cloudputBlockCallback$block_4$RUBY$__block__xx1.call(Unknown
 Source)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:120)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:64)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:70)
        at org.jruby.runtime.Block.call(Block.java:116)
        at org.jruby.RubyProc.call(RubyProc.java:205)
        at org.jruby.RubyProc.call(RubyProc.java:187)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:90)
        at java.lang.Thread.run(Thread.java:619)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to